dynamic-active-model 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dynamic-active-model/database.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2664e9a3b74032d4296a54416912c82bf4f23ce605867215b95676d889d791ed
|
|
4
|
+
data.tar.gz: 9a85b302c4ed61002b9379f2b1b9812632d2c51696dfa2e1e4b02ec1546eac89
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 475f4bf0369216319169d75505800bc795cc7077b3aaa9e599eaf6b3c167093bc423bd280ad8d4435887b0883ff75b9463cfecd047fa1646d1b7a11ec737aa87
|
|
7
|
+
data.tar.gz: 1d6081d4fa6c1d36d8e9d9b68392219d85ff2cc50eade08f879c5f56fbb61fa46ec3c1ea6ba475453142f430822fd4361540fdb3f1834ddff18b456d59a72528
|
|
@@ -150,7 +150,11 @@ module DynamicActiveModel
|
|
|
150
150
|
# @return [Class] The updated model class
|
|
151
151
|
def update_model(table_name, file = nil, &block)
|
|
152
152
|
model = get_model!(table_name)
|
|
153
|
-
|
|
153
|
+
if file
|
|
154
|
+
updater = ModelUpdater.new(model)
|
|
155
|
+
ctx = updater.instance_eval { binding }
|
|
156
|
+
eval(File.read(file), ctx, file, 1)
|
|
157
|
+
end
|
|
154
158
|
model.class_eval(&block) if block
|
|
155
159
|
model
|
|
156
160
|
end
|