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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a37cee4486a59afc3ec2e4595755fe94dcd0590a
4
- data.tar.gz: 50b460a2440aa47b459f07b4cd1d0e65a16d5c2d
3
+ metadata.gz: ba5e328ca51b78cf16618659ee5b14ee4e073ea3
4
+ data.tar.gz: 961de4084df9b8222d86791076699acdf72b9274
5
5
  SHA512:
6
- metadata.gz: 5fd3eacbf0f3f9a726b85112fcef0f3dcd7f075ddbfe2a9141a5ea129eec4eb69e7d267effa73a141b8fe8eb5192c136e318036591515c70d7793258ac5e2252
7
- data.tar.gz: fa185aba86e7dece57b160ab6a59fe8d1e5bc7f99f4e41011f673e4888e6b5aabfc9fd135b5fbab68f397f7f5bfd1201a3e2240ac3110000ebfa568955b5d656
6
+ metadata.gz: e8661cded3aebec52b18822698a172ab529b262d9cf3497e61fc51f7925793d0aab5f4cdf16af09b6689453e633ec55da06c893e4f4b1471161e7ee6b89f4141
7
+ data.tar.gz: 7e62a195a821ec377c76590e42036fcfc48addecf6b73b5f8ac8970a598f918c324f96c4b6e1aab6610c113852d29269956025ac96e3569794d6c0478897a599
@@ -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
@@ -43,7 +43,7 @@ module ActiveRecord
43
43
 
44
44
  def _assign_attribute(k, v)
45
45
  public_send("#{k}=", v)
46
- rescue NoMethodError
46
+ rescue NoMethodError, NameError
47
47
  if respond_to?("#{k}=")
48
48
  raise
49
49
  else
@@ -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
- method = (collection ? :validate_collection_association : :validate_single_association)
209
- define_non_cyclic_method(validation_method) { send(method, reflection) }
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
@@ -273,7 +273,7 @@ module ActiveRecord
273
273
  end
274
274
 
275
275
  def full_version
276
- @full_version ||= @connection.info[:version]
276
+ @full_version ||= @connection.server_info[:version]
277
277
  end
278
278
 
279
279
  def set_field_encoding field_name
@@ -7,8 +7,8 @@ module ActiveRecord
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 1
10
- TINY = 12
11
- PRE = nil
10
+ TINY = 13
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  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
- add_autosave_association_callbacks(reflection)
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
- arel.ast.grep(Arel::Nodes::BindParam).each_with_index do |bp, i|
871
- column = bvs[i].first
872
- bp.replace connection.substitute_at(column, i)
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.12
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-06-25 00:00:00.000000000 Z
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.12
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.12
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.12
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.12
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: '0'
248
+ version: 1.3.1
249
249
  requirements: []
250
250
  rubyforge_project:
251
- rubygems_version: 2.4.5
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: