mongoid 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongoid/attributes.rb +3 -1
- data/lib/mongoid/paranoia.rb +3 -2
- data/lib/mongoid/persistence.rb +2 -1
- data/lib/mongoid/relations/builder.rb +1 -1
- data/lib/mongoid/version.rb +1 -1
- metadata +18 -18
data/lib/mongoid/attributes.rb
CHANGED
@@ -94,7 +94,9 @@ module Mongoid #:nodoc:
|
|
94
94
|
def write_attribute(name, value)
|
95
95
|
access = name.to_s
|
96
96
|
typed_value_for(access, value).tap do |value|
|
97
|
-
|
97
|
+
unless attributes[access] == value || attribute_changed?(access)
|
98
|
+
attribute_will_change!(access)
|
99
|
+
end
|
98
100
|
attributes[access] = value
|
99
101
|
end
|
100
102
|
end
|
data/lib/mongoid/paranoia.rb
CHANGED
@@ -56,6 +56,7 @@ module Mongoid #:nodoc:
|
|
56
56
|
#
|
57
57
|
# @example Is the document destroyed?
|
58
58
|
# person.destroyed?
|
59
|
+
|
59
60
|
#
|
60
61
|
# @return [ true, false ] If the document is destroyed.
|
61
62
|
def destroyed?
|
@@ -83,8 +84,8 @@ module Mongoid #:nodoc:
|
|
83
84
|
# @param [ Array ] args The arguments.
|
84
85
|
#
|
85
86
|
# @return [ Criteria ] The paranoid compliant criteria.
|
86
|
-
def criteria(
|
87
|
-
super.where(:deleted_at.exists => false)
|
87
|
+
def criteria(embedded = false, scoped = true)
|
88
|
+
scoped ? super.where(:deleted_at.exists => false) : super
|
88
89
|
end
|
89
90
|
|
90
91
|
# Find deleted documents
|
data/lib/mongoid/persistence.rb
CHANGED
@@ -95,7 +95,8 @@ module Mongoid #:nodoc:
|
|
95
95
|
#
|
96
96
|
# @since 2.0.0.rc.6
|
97
97
|
def update_attribute(name, value)
|
98
|
-
write_attribute(name, value)
|
98
|
+
write_attribute(name, value)
|
99
|
+
save(:validate => false)
|
99
100
|
end
|
100
101
|
|
101
102
|
# Update the document attributes in the datbase.
|
data/lib/mongoid/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activemodel
|
17
|
-
requirement: &
|
17
|
+
requirement: &2151817520 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '3.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2151817520
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: tzinfo
|
28
|
-
requirement: &
|
28
|
+
requirement: &2151806700 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 0.3.22
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2151806700
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: mongo
|
39
|
-
requirement: &
|
39
|
+
requirement: &2151801860 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '1.3'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2151801860
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rdoc
|
50
|
-
requirement: &
|
50
|
+
requirement: &2151792280 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 3.5.0
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2151792280
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: bson_ext
|
61
|
-
requirement: &
|
61
|
+
requirement: &2151790140 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '1.3'
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2151790140
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: mocha
|
72
|
-
requirement: &
|
72
|
+
requirement: &2151788460 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - =
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 0.9.8
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2151788460
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: rspec
|
83
|
-
requirement: &
|
83
|
+
requirement: &2151786380 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: '2.6'
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *2151786380
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: watchr
|
94
|
-
requirement: &
|
94
|
+
requirement: &2151784760 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - =
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
version: '0.6'
|
100
100
|
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *2151784760
|
103
103
|
description: Mongoid is an ODM (Object Document Mapper) Framework for MongoDB, written
|
104
104
|
in Ruby.
|
105
105
|
email:
|
@@ -380,7 +380,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
380
380
|
version: '0'
|
381
381
|
segments:
|
382
382
|
- 0
|
383
|
-
hash:
|
383
|
+
hash: -4071051164423379877
|
384
384
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
385
385
|
none: false
|
386
386
|
requirements:
|