denormalize-field 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/denormalize-field.gemspec +1 -1
- data/lib/denormalize-field.rb +6 -6
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/denormalize-field.gemspec
CHANGED
data/lib/denormalize-field.rb
CHANGED
@@ -13,13 +13,13 @@ module DenormalizeFields
|
|
13
13
|
self.send "#{_denormalized_field_name}=", self.send(key).send(_field_name)
|
14
14
|
end
|
15
15
|
_original_klass = self.class
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
18
|
+
_klass = key.to_s.camelize.constantize
|
19
|
+
_klass.after_save do
|
20
|
+
if self.send "#{_field_name}_changed?"
|
21
|
+
self.send(_original_klass.name.downcase.pluralize).each do |child|
|
22
|
+
child.update_attribute _denormalized_field_name, self.send(_field_name)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: denormalize-field
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -159,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
segments:
|
161
161
|
- 0
|
162
|
-
hash:
|
162
|
+
hash: 3644186894765789279
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
none: false
|
165
165
|
requirements:
|