custom_fields 1.0.0.beta.8 → 1.0.0.beta.9

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -6,7 +6,7 @@ Manage custom fields to a mongoid document or a collection. This module is one o
6
6
  Requirements
7
7
  =======
8
8
 
9
- ActiveSupport 3.0, MongoDB 1.6 and mongoid 2.0.0.rc.6
9
+ ActiveSupport 3.0, MongoDB 1.6 and mongoid 2.0.0.rc.7
10
10
 
11
11
 
12
12
  Example
@@ -34,10 +34,9 @@ module CustomFields
34
34
 
35
35
  ## callbacks ##
36
36
  before_validation :set_alias
37
- after_validation :set_target_klass_flag, :if => Proc.new { |f| f.changed? }
37
+ after_validation :set_target_klass_flag
38
38
 
39
- before_create :invalidate_target_klass
40
- before_update :invalidate_target_klass
39
+ before_save :invalidate_target_klass
41
40
  after_destroy :invalidate_target_klass
42
41
 
43
42
  ## methods ##
@@ -163,8 +162,11 @@ module CustomFields
163
162
  if self._parent.instance_variable_get(:@_writing_attributes_with_custom_fields)
164
163
  if self.destroyed? # force the parent to invalidate the related target class
165
164
  self.set_target_klass_flag
165
+ elsif self.changed?
166
+ self.set_target_klass_flag
166
167
  end
167
168
  else
169
+ self.set_target_klass_flag
168
170
  self._parent.save
169
171
  end
170
172
  end
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module CustomFields
3
- VERSION = "1.0.0.beta.8"
3
+ VERSION = "1.0.0.beta.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_fields
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196371
4
+ hash: 62196369
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
10
  - beta
11
- - 8
12
- version: 1.0.0.beta.8
11
+ - 9
12
+ version: 1.0.0.beta.9
13
13
  platform: ruby
14
14
  authors:
15
15
  - Didier Lafforgue
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-03-20 00:00:00 +01:00
20
+ date: 2011-03-22 00:00:00 +01:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency