activerecord 4.1.12 → 4.1.13.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activerecord might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/active_record/attribute_assignment.rb +1 -1
- data/lib/active_record/autosave_association.rb +16 -5
- data/lib/active_record/connection_adapters/mysql2_adapter.rb +1 -1
- data/lib/active_record/gem_version.rb +2 -2
- data/lib/active_record/nested_attributes.rb +1 -1
- data/lib/active_record/railtie.rb +1 -1
- data/lib/active_record/relation/query_methods.rb +5 -3
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba5e328ca51b78cf16618659ee5b14ee4e073ea3
|
4
|
+
data.tar.gz: 961de4084df9b8222d86791076699acdf72b9274
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8661cded3aebec52b18822698a172ab529b262d9cf3497e61fc51f7925793d0aab5f4cdf16af09b6689453e633ec55da06c893e4f4b1471161e7ee6b89f4141
|
7
|
+
data.tar.gz: 7e62a195a821ec377c76590e42036fcfc48addecf6b73b5f8ac8970a598f918c324f96c4b6e1aab6610c113852d29269956025ac96e3569794d6c0478897a599
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## Rails 4.1.13 (August 14, 2015) ##
|
2
|
+
|
3
|
+
* Don't define autosave association callbacks twice from
|
4
|
+
`accepts_nested_attributes_for`.
|
5
|
+
|
6
|
+
Fixes #18704.
|
7
|
+
|
8
|
+
*Sean Griffin*
|
9
|
+
|
1
10
|
## Rails 4.1.12 (June 25, 2015) ##
|
2
11
|
|
3
12
|
* Raises the right exception when declares a has many through
|
@@ -177,10 +177,8 @@ module ActiveRecord
|
|
177
177
|
# before actually defining them.
|
178
178
|
def add_autosave_association_callbacks(reflection)
|
179
179
|
save_method = :"autosave_associated_records_for_#{reflection.name}"
|
180
|
-
validation_method = :"validate_associated_records_for_#{reflection.name}"
|
181
|
-
collection = reflection.collection?
|
182
180
|
|
183
|
-
if collection
|
181
|
+
if reflection.collection?
|
184
182
|
before_save :before_save_collection_association
|
185
183
|
|
186
184
|
define_non_cyclic_method(save_method) { save_collection_association(reflection) }
|
@@ -204,9 +202,22 @@ module ActiveRecord
|
|
204
202
|
before_save save_method
|
205
203
|
end
|
206
204
|
|
205
|
+
define_autosave_validation_callbacks(reflection)
|
206
|
+
end
|
207
|
+
|
208
|
+
def define_autosave_validation_callbacks(reflection)
|
209
|
+
validation_method = :"validate_associated_records_for_#{reflection.name}"
|
207
210
|
if reflection.validate? && !method_defined?(validation_method)
|
208
|
-
|
209
|
-
|
211
|
+
if reflection.collection?
|
212
|
+
method = :validate_collection_association
|
213
|
+
else
|
214
|
+
method = :validate_single_association
|
215
|
+
end
|
216
|
+
|
217
|
+
define_non_cyclic_method(validation_method) do
|
218
|
+
send(method, reflection)
|
219
|
+
true
|
220
|
+
end
|
210
221
|
validate validation_method
|
211
222
|
end
|
212
223
|
end
|
@@ -307,7 +307,7 @@ module ActiveRecord
|
|
307
307
|
attr_names.each do |association_name|
|
308
308
|
if reflection = _reflect_on_association(association_name)
|
309
309
|
reflection.autosave = true
|
310
|
-
|
310
|
+
define_autosave_validation_callbacks(reflection)
|
311
311
|
|
312
312
|
nested_attributes_options = self.nested_attributes_options.dup
|
313
313
|
nested_attributes_options[association_name.to_sym] = options
|
@@ -142,8 +142,8 @@ module ActiveRecord
|
|
142
142
|
ActiveSupport.on_load(:active_record) do
|
143
143
|
ActionDispatch::Reloader.send(hook) do
|
144
144
|
if ActiveRecord::Base.connected?
|
145
|
-
ActiveRecord::Base.clear_reloadable_connections!
|
146
145
|
ActiveRecord::Base.clear_cache!
|
146
|
+
ActiveRecord::Base.clear_reloadable_connections!
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
@@ -867,9 +867,11 @@ module ActiveRecord
|
|
867
867
|
|
868
868
|
# Reorder bind indexes if joins produced bind values
|
869
869
|
bvs = arel.bind_values + bind_values
|
870
|
-
|
871
|
-
|
872
|
-
|
870
|
+
if bvs.any?
|
871
|
+
arel.ast.grep(Arel::Nodes::BindParam).each_with_index do |bp, i|
|
872
|
+
column = bvs[i].first
|
873
|
+
bp.replace connection.substitute_at(column, i)
|
874
|
+
end
|
873
875
|
end
|
874
876
|
|
875
877
|
arel
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.13.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.1.
|
19
|
+
version: 4.1.13.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.1.
|
26
|
+
version: 4.1.13.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activemodel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.1.
|
33
|
+
version: 4.1.13.rc1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.1.
|
40
|
+
version: 4.1.13.rc1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: arel
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -243,13 +243,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
243
|
version: 1.9.3
|
244
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
|
-
- - "
|
246
|
+
- - ">"
|
247
247
|
- !ruby/object:Gem::Version
|
248
|
-
version:
|
248
|
+
version: 1.3.1
|
249
249
|
requirements: []
|
250
250
|
rubyforge_project:
|
251
|
-
rubygems_version: 2.4.
|
251
|
+
rubygems_version: 2.4.7
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: Object-relational mapper framework (part of Rails).
|
255
255
|
test_files: []
|
256
|
+
has_rdoc:
|