activerecord 3.2.19 → 3.2.22.5

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.

@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b2a1b133cbd413ee58ccc671828333632ed6db3b
4
+ data.tar.gz: 8f7eed84647eebadf1270dc241dca3063b4586f5
5
+ SHA512:
6
+ metadata.gz: 0bef1cca318f136e3c84fda17c030b840b6d889a836dee9753b000bde1fa951b90873145d6a79f7f42d76db8ae6fa66e79244baea47f5e440f8dafa1ecd6325e
7
+ data.tar.gz: 98f44f3efcaa299b5044a14851dc577b63c6281d4f18c152ce2fd4de1562170e8fa6aac3109eb101fdc1b5df05f5cb06efc1b8ea6ab7e69e080ebbac137a74fd
@@ -1,3 +1,14 @@
1
+ * Support Ruby 2.3 by not unexpectedly calling `.to_proc` on Hash objects
2
+
3
+ Fixes #25010
4
+
5
+ *tlrdstd*
6
+
7
+ ## Rails 3.2.22 (Jun 16, 2015) ##
8
+
9
+ * No changes.
10
+
11
+
1
12
  ## Rails 3.2.19 (Jul 2, 2014) ##
2
13
 
3
14
  * Fix SQL Injection Vulnerability in 'bitstring' quoting.
@@ -158,7 +158,7 @@ module ActiveRecord
158
158
  end
159
159
 
160
160
  def interpolate(sql, record = nil)
161
- if sql.respond_to?(:to_proc)
161
+ if sql.respond_to?(:to_proc) && !sql.is_a?(Hash)
162
162
  owner.send(:instance_exec, record, &sql)
163
163
  else
164
164
  sql
@@ -50,15 +50,15 @@ module ActiveRecord
50
50
  [options[:limit], count].compact.min
51
51
  end
52
52
 
53
- def has_cached_counter?(reflection = reflection)
53
+ def has_cached_counter?(reflection = self.reflection)
54
54
  owner.attribute_present?(cached_counter_attribute_name(reflection))
55
55
  end
56
56
 
57
- def cached_counter_attribute_name(reflection = reflection)
57
+ def cached_counter_attribute_name(reflection = self.reflection)
58
58
  "#{reflection.name}_count"
59
59
  end
60
60
 
61
- def update_counter(difference, reflection = reflection)
61
+ def update_counter(difference, reflection = self.reflection)
62
62
  if has_cached_counter?(reflection)
63
63
  counter = cached_counter_attribute_name(reflection)
64
64
  owner.class.update_counters(owner.id, counter => difference)
@@ -77,7 +77,7 @@ module ActiveRecord
77
77
  # it will be decremented twice.
78
78
  #
79
79
  # Hence this method.
80
- def inverse_updates_counter_cache?(reflection = reflection)
80
+ def inverse_updates_counter_cache?(reflection = self.reflection)
81
81
  counter_name = cached_counter_attribute_name(reflection)
82
82
  reflection.klass.reflect_on_all_associations(:belongs_to).any? { |inverse_reflection|
83
83
  inverse_reflection.counter_cache_column == counter_name
@@ -146,7 +146,7 @@ module ActiveRecord
146
146
  private
147
147
 
148
148
  def interpolate(conditions)
149
- if conditions.respond_to?(:to_proc)
149
+ if conditions.respond_to?(:to_proc) && !conditions.is_a?(Hash)
150
150
  instance_eval(&conditions)
151
151
  else
152
152
  conditions
@@ -113,7 +113,7 @@ module ActiveRecord
113
113
  end
114
114
 
115
115
  def process_conditions(conditions)
116
- if conditions.respond_to?(:to_proc)
116
+ if conditions.respond_to?(:to_proc) && !conditions.is_a?(Hash)
117
117
  conditions = klass.send(:instance_eval, &conditions)
118
118
  end
119
119
 
@@ -589,7 +589,7 @@ module ActiveRecord
589
589
 
590
590
  # interpolate the fixture label
591
591
  row.each do |key, value|
592
- row[key] = label if value == "$LABEL"
592
+ row[key] = label if value.is_a?(String) && value == "$LABEL"
593
593
  end
594
594
 
595
595
  # generate a primary key if necessary
@@ -470,11 +470,12 @@ module ActiveRecord
470
470
  # has_destroy_flag? or if a <tt>:reject_if</tt> proc exists for this
471
471
  # association and evaluates to +true+.
472
472
  def reject_new_record?(association_name, attributes)
473
- has_destroy_flag?(attributes) || call_reject_if(association_name, attributes)
473
+ will_be_destroyed?(association_name, attributes) || call_reject_if(association_name, attributes)
474
474
  end
475
475
 
476
476
  def call_reject_if(association_name, attributes)
477
- return false if has_destroy_flag?(attributes)
477
+ return false if will_be_destroyed?(association_name, attributes)
478
+
478
479
  case callback = self.nested_attributes_options[association_name][:reject_if]
479
480
  when Symbol
480
481
  method(callback).arity == 0 ? send(callback) : send(callback, attributes)
@@ -483,6 +484,15 @@ module ActiveRecord
483
484
  end
484
485
  end
485
486
 
487
+ # Only take into account the destroy flag if <tt>:allow_destroy</tt> is true
488
+ def will_be_destroyed?(association_name, attributes)
489
+ allow_destroy?(association_name) && has_destroy_flag?(attributes)
490
+ end
491
+
492
+ def allow_destroy?(association_name)
493
+ self.nested_attributes_options[association_name][:allow_destroy]
494
+ end
495
+
486
496
  def raise_nested_attributes_record_not_found(association_name, record_id)
487
497
  raise RecordNotFound, "Couldn't find #{self.class.reflect_on_association(association_name).klass.name} with ID=#{record_id} for #{self.class.name} with ID=#{id}"
488
498
  end
@@ -2,8 +2,8 @@ module ActiveRecord
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
- TINY = 19
6
- PRE = nil
5
+ TINY = 22
6
+ PRE = "5"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,103 +1,89 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
- version: !ruby/object:Gem::Version
4
- hash: 41
5
- prerelease:
6
- segments:
7
- - 3
8
- - 2
9
- - 19
10
- version: 3.2.19
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.2.22.5
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - David Heinemeier Hansson
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2014-07-02 00:00:00 -03:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - "="
26
- - !ruby/object:Gem::Version
27
- hash: 41
28
- segments:
29
- - 3
30
- - 2
31
- - 19
32
- version: 3.2.19
33
- type: :runtime
34
- version_requirements: *id001
35
- prerelease: false
11
+ date: 2016-09-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
36
14
  name: activesupport
37
- - !ruby/object:Gem::Dependency
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - "="
42
- - !ruby/object:Gem::Version
43
- hash: 41
44
- segments:
45
- - 3
46
- - 2
47
- - 19
48
- version: 3.2.19
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.22.5
49
20
  type: :runtime
50
- version_requirements: *id002
51
21
  prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.22.5
27
+ - !ruby/object:Gem::Dependency
52
28
  name: activemodel
53
- - !ruby/object:Gem::Dependency
54
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
57
- - - ~>
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 3
62
- - 0
63
- - 2
64
- version: 3.0.2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 3.2.22.5
65
34
  type: :runtime
66
- version_requirements: *id003
67
35
  prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.22.5
41
+ - !ruby/object:Gem::Dependency
68
42
  name: arel
69
- - !ruby/object:Gem::Dependency
70
- requirement: &id004 !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 41
76
- segments:
77
- - 0
78
- - 3
79
- - 29
80
- version: 0.3.29
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.0.2
81
48
  type: :runtime
82
- version_requirements: *id004
83
49
  prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.0.2
55
+ - !ruby/object:Gem::Dependency
84
56
  name: tzinfo
85
- description: Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in.
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.3.29
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.3.29
69
+ description: Databases on Rails. Build a persistent domain model by mapping database
70
+ tables to Ruby classes. Strong conventions for associations, validations, aggregations,
71
+ migrations, and testing come baked-in.
86
72
  email: david@loudthinking.com
87
73
  executables: []
88
-
89
74
  extensions: []
90
-
91
- extra_rdoc_files:
75
+ extra_rdoc_files:
92
76
  - README.rdoc
93
- files:
77
+ files:
94
78
  - CHANGELOG.md
95
79
  - MIT-LICENSE
96
80
  - README.rdoc
97
81
  - examples/associations.png
98
82
  - examples/performance.rb
99
83
  - examples/simple.rb
84
+ - lib/active_record.rb
100
85
  - lib/active_record/aggregations.rb
86
+ - lib/active_record/associations.rb
101
87
  - lib/active_record/associations/alias_tracker.rb
102
88
  - lib/active_record/associations/association.rb
103
89
  - lib/active_record/associations/association_scope.rb
@@ -117,11 +103,12 @@ files:
117
103
  - lib/active_record/associations/has_many_through_association.rb
118
104
  - lib/active_record/associations/has_one_association.rb
119
105
  - lib/active_record/associations/has_one_through_association.rb
106
+ - lib/active_record/associations/join_dependency.rb
120
107
  - lib/active_record/associations/join_dependency/join_association.rb
121
108
  - lib/active_record/associations/join_dependency/join_base.rb
122
109
  - lib/active_record/associations/join_dependency/join_part.rb
123
- - lib/active_record/associations/join_dependency.rb
124
110
  - lib/active_record/associations/join_helper.rb
111
+ - lib/active_record/associations/preloader.rb
125
112
  - lib/active_record/associations/preloader/association.rb
126
113
  - lib/active_record/associations/preloader/belongs_to.rb
127
114
  - lib/active_record/associations/preloader/collection_association.rb
@@ -132,11 +119,10 @@ files:
132
119
  - lib/active_record/associations/preloader/has_one_through.rb
133
120
  - lib/active_record/associations/preloader/singular_association.rb
134
121
  - lib/active_record/associations/preloader/through_association.rb
135
- - lib/active_record/associations/preloader.rb
136
122
  - lib/active_record/associations/singular_association.rb
137
123
  - lib/active_record/associations/through_association.rb
138
- - lib/active_record/associations.rb
139
124
  - lib/active_record/attribute_assignment.rb
125
+ - lib/active_record/attribute_methods.rb
140
126
  - lib/active_record/attribute_methods/before_type_cast.rb
141
127
  - lib/active_record/attribute_methods/deprecated_underscore_read.rb
142
128
  - lib/active_record/attribute_methods/dirty.rb
@@ -146,7 +132,6 @@ files:
146
132
  - lib/active_record/attribute_methods/serialization.rb
147
133
  - lib/active_record/attribute_methods/time_zone_conversion.rb
148
134
  - lib/active_record/attribute_methods/write.rb
149
- - lib/active_record/attribute_methods.rb
150
135
  - lib/active_record/autosave_association.rb
151
136
  - lib/active_record/base.rb
152
137
  - lib/active_record/callbacks.rb
@@ -176,8 +161,8 @@ files:
176
161
  - lib/active_record/errors.rb
177
162
  - lib/active_record/explain.rb
178
163
  - lib/active_record/explain_subscriber.rb
179
- - lib/active_record/fixtures/file.rb
180
164
  - lib/active_record/fixtures.rb
165
+ - lib/active_record/fixtures/file.rb
181
166
  - lib/active_record/identity_map.rb
182
167
  - lib/active_record/inheritance.rb
183
168
  - lib/active_record/integration.rb
@@ -185,8 +170,8 @@ files:
185
170
  - lib/active_record/locking/optimistic.rb
186
171
  - lib/active_record/locking/pessimistic.rb
187
172
  - lib/active_record/log_subscriber.rb
188
- - lib/active_record/migration/command_recorder.rb
189
173
  - lib/active_record/migration.rb
174
+ - lib/active_record/migration/command_recorder.rb
190
175
  - lib/active_record/model_schema.rb
191
176
  - lib/active_record/nested_attributes.rb
192
177
  - lib/active_record/observer.rb
@@ -200,6 +185,7 @@ files:
200
185
  - lib/active_record/railties/jdbcmysql_error.rb
201
186
  - lib/active_record/readonly_attributes.rb
202
187
  - lib/active_record/reflection.rb
188
+ - lib/active_record/relation.rb
203
189
  - lib/active_record/relation/batches.rb
204
190
  - lib/active_record/relation/calculations.rb
205
191
  - lib/active_record/relation/delegation.rb
@@ -207,14 +193,13 @@ files:
207
193
  - lib/active_record/relation/predicate_builder.rb
208
194
  - lib/active_record/relation/query_methods.rb
209
195
  - lib/active_record/relation/spawn_methods.rb
210
- - lib/active_record/relation.rb
211
196
  - lib/active_record/result.rb
212
197
  - lib/active_record/sanitization.rb
213
198
  - lib/active_record/schema.rb
214
199
  - lib/active_record/schema_dumper.rb
200
+ - lib/active_record/scoping.rb
215
201
  - lib/active_record/scoping/default.rb
216
202
  - lib/active_record/scoping/named.rb
217
- - lib/active_record/scoping.rb
218
203
  - lib/active_record/serialization.rb
219
204
  - lib/active_record/serializers/xml_serializer.rb
220
205
  - lib/active_record/session_store.rb
@@ -223,14 +208,14 @@ files:
223
208
  - lib/active_record/timestamp.rb
224
209
  - lib/active_record/transactions.rb
225
210
  - lib/active_record/translation.rb
211
+ - lib/active_record/validations.rb
226
212
  - lib/active_record/validations/associated.rb
227
213
  - lib/active_record/validations/uniqueness.rb
228
- - lib/active_record/validations.rb
229
214
  - lib/active_record/version.rb
230
- - lib/active_record.rb
215
+ - lib/rails/generators/active_record.rb
216
+ - lib/rails/generators/active_record/migration.rb
231
217
  - lib/rails/generators/active_record/migration/migration_generator.rb
232
218
  - lib/rails/generators/active_record/migration/templates/migration.rb
233
- - lib/rails/generators/active_record/migration.rb
234
219
  - lib/rails/generators/active_record/model/model_generator.rb
235
220
  - lib/rails/generators/active_record/model/templates/migration.rb
236
221
  - lib/rails/generators/active_record/model/templates/model.rb
@@ -239,43 +224,31 @@ files:
239
224
  - lib/rails/generators/active_record/observer/templates/observer.rb
240
225
  - lib/rails/generators/active_record/session_migration/session_migration_generator.rb
241
226
  - lib/rails/generators/active_record/session_migration/templates/migration.rb
242
- - lib/rails/generators/active_record.rb
243
- has_rdoc: true
244
227
  homepage: http://www.rubyonrails.org
245
- licenses:
228
+ licenses:
246
229
  - MIT
230
+ metadata: {}
247
231
  post_install_message:
248
- rdoc_options:
249
- - --main
232
+ rdoc_options:
233
+ - "--main"
250
234
  - README.rdoc
251
- require_paths:
235
+ require_paths:
252
236
  - lib
253
- required_ruby_version: !ruby/object:Gem::Requirement
254
- none: false
255
- requirements:
237
+ required_ruby_version: !ruby/object:Gem::Requirement
238
+ requirements:
256
239
  - - ">="
257
- - !ruby/object:Gem::Version
258
- hash: 57
259
- segments:
260
- - 1
261
- - 8
262
- - 7
240
+ - !ruby/object:Gem::Version
263
241
  version: 1.8.7
264
- required_rubygems_version: !ruby/object:Gem::Requirement
265
- none: false
266
- requirements:
242
+ required_rubygems_version: !ruby/object:Gem::Requirement
243
+ requirements:
267
244
  - - ">="
268
- - !ruby/object:Gem::Version
269
- hash: 3
270
- segments:
271
- - 0
272
- version: "0"
245
+ - !ruby/object:Gem::Version
246
+ version: '0'
273
247
  requirements: []
274
-
275
248
  rubyforge_project:
276
- rubygems_version: 1.6.2
249
+ rubygems_version: 2.6.6
277
250
  signing_key:
278
- specification_version: 3
251
+ specification_version: 4
279
252
  summary: Object-relational mapper framework (part of Rails).
280
253
  test_files: []
281
-
254
+ has_rdoc: