data_tables 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/data_tables.rb +5 -1
- metadata +1 -1
data/lib/data_tables.rb
CHANGED
@@ -9,7 +9,11 @@ module DataTablesController
|
|
9
9
|
modelCls = Kernel.const_get(model.to_s.split("_").collect(&:capitalize).join)
|
10
10
|
modelAttrs = nil
|
11
11
|
if modelCls < Ohm::Model
|
12
|
-
|
12
|
+
if Gem.loaded_specs['ohm'].version == Gem::Version.create('0.1.5')
|
13
|
+
modelAttrs = Hash[*modelCls.new.attributes.collect { |v| [v.to_s, nil] }.flatten]
|
14
|
+
else
|
15
|
+
modelAttrs = {}
|
16
|
+
end
|
13
17
|
else
|
14
18
|
modelAttrs = modelCls.new.attributes
|
15
19
|
end
|