activerecord 4.1.1 → 4.1.2.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 +7 -0
- data/CHANGELOG.md +312 -0
- data/lib/active_record/association_relation.rb +4 -0
- data/lib/active_record/associations.rb +24 -3
- data/lib/active_record/associations/association.rb +1 -1
- data/lib/active_record/associations/builder/has_and_belongs_to_many.rb +10 -4
- data/lib/active_record/associations/builder/has_many.rb +1 -1
- data/lib/active_record/associations/collection_association.rb +5 -5
- data/lib/active_record/associations/collection_proxy.rb +4 -0
- data/lib/active_record/associations/has_many_association.rb +6 -5
- data/lib/active_record/associations/has_many_through_association.rb +6 -2
- data/lib/active_record/associations/join_dependency.rb +1 -1
- data/lib/active_record/associations/join_dependency/join_association.rb +1 -1
- data/lib/active_record/associations/preloader.rb +14 -35
- data/lib/active_record/associations/preloader/association.rb +26 -5
- data/lib/active_record/associations/singular_association.rb +3 -3
- data/lib/active_record/associations/through_association.rb +4 -2
- data/lib/active_record/attribute_methods.rb +2 -0
- data/lib/active_record/attribute_methods/dirty.rb +2 -2
- data/lib/active_record/attribute_methods/serialization.rb +24 -5
- data/lib/active_record/attribute_methods/write.rb +22 -14
- data/lib/active_record/autosave_association.rb +40 -35
- data/lib/active_record/base.rb +2 -2
- data/lib/active_record/callbacks.rb +2 -2
- data/lib/active_record/connection_adapters/abstract/database_statements.rb +10 -13
- data/lib/active_record/connection_adapters/abstract/query_cache.rb +1 -0
- data/lib/active_record/connection_adapters/abstract/schema_creation.rb +7 -1
- data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +1 -1
- data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +8 -6
- data/lib/active_record/connection_adapters/postgresql/database_statements.rb +1 -4
- data/lib/active_record/connection_adapters/postgresql/oid.rb +10 -5
- data/lib/active_record/connection_adapters/postgresql/quoting.rb +9 -0
- data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +11 -6
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +7 -0
- data/lib/active_record/connection_adapters/sqlite3_adapter.rb +6 -3
- data/lib/active_record/connection_handling.rb +2 -2
- data/lib/active_record/core.rb +3 -0
- data/lib/active_record/counter_cache.rb +2 -3
- data/lib/active_record/fixtures.rb +1 -1
- data/lib/active_record/gem_version.rb +2 -2
- data/lib/active_record/locking/optimistic.rb +1 -1
- data/lib/active_record/log_subscriber.rb +1 -1
- data/lib/active_record/migration.rb +1 -1
- data/lib/active_record/nested_attributes.rb +2 -2
- data/lib/active_record/null_relation.rb +19 -5
- data/lib/active_record/persistence.rb +8 -8
- data/lib/active_record/railties/databases.rake +3 -2
- data/lib/active_record/reflection.rb +45 -13
- data/lib/active_record/relation.rb +7 -6
- data/lib/active_record/relation/calculations.rb +10 -2
- data/lib/active_record/relation/delegation.rb +2 -2
- data/lib/active_record/relation/finder_methods.rb +1 -1
- data/lib/active_record/relation/merger.rb +10 -2
- data/lib/active_record/relation/predicate_builder.rb +2 -2
- data/lib/active_record/relation/query_methods.rb +2 -2
- data/lib/active_record/scoping/default.rb +3 -3
- data/lib/active_record/store.rb +14 -5
- data/lib/active_record/timestamp.rb +2 -2
- data/lib/active_record/transactions.rb +1 -1
- data/lib/active_record/validations/presence.rb +1 -1
- data/lib/active_record/validations/uniqueness.rb +2 -2
- metadata +27 -35
@@ -43,7 +43,7 @@ module ActiveRecord
|
|
43
43
|
|
44
44
|
private
|
45
45
|
|
46
|
-
def
|
46
|
+
def _create_record
|
47
47
|
if self.record_timestamps
|
48
48
|
current_time = current_time_from_proper_timezone
|
49
49
|
|
@@ -57,7 +57,7 @@ module ActiveRecord
|
|
57
57
|
super
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
60
|
+
def _update_record(*args)
|
61
61
|
if should_record_timestamps?
|
62
62
|
current_time = current_time_from_proper_timezone
|
63
63
|
|
@@ -369,7 +369,7 @@ module ActiveRecord
|
|
369
369
|
@new_record = restore_state[:new_record]
|
370
370
|
@destroyed = restore_state[:destroyed]
|
371
371
|
if restore_state.has_key?(:id)
|
372
|
-
self.
|
372
|
+
write_attribute(self.class.primary_key, restore_state[:id])
|
373
373
|
else
|
374
374
|
@attributes.delete(self.class.primary_key)
|
375
375
|
@attributes_cache.delete(self.class.primary_key)
|
@@ -4,7 +4,7 @@ module ActiveRecord
|
|
4
4
|
def validate(record)
|
5
5
|
super
|
6
6
|
attributes.each do |attribute|
|
7
|
-
next unless record.class.
|
7
|
+
next unless record.class._reflect_on_association(attribute)
|
8
8
|
associated_records = Array.wrap(record.send(attribute))
|
9
9
|
|
10
10
|
# Superclass validates presence. Ensure present records aren't about to be destroyed.
|
@@ -47,7 +47,7 @@ module ActiveRecord
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def build_relation(klass, table, attribute, value) #:nodoc:
|
50
|
-
if reflection = klass.
|
50
|
+
if reflection = klass._reflect_on_association(attribute)
|
51
51
|
attribute = reflection.foreign_key
|
52
52
|
value = value.attributes[reflection.primary_key_column.name] unless value.nil?
|
53
53
|
end
|
@@ -75,7 +75,7 @@ module ActiveRecord
|
|
75
75
|
|
76
76
|
def scope_relation(record, table, relation)
|
77
77
|
Array(options[:scope]).each do |scope_item|
|
78
|
-
if reflection = record.class.
|
78
|
+
if reflection = record.class._reflect_on_association(scope_item)
|
79
79
|
scope_value = record.send(reflection.foreign_key)
|
80
80
|
scope_item = reflection.foreign_key
|
81
81
|
else
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
5
|
-
prerelease:
|
4
|
+
version: 4.1.2.rc1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- David Heinemeier Hansson
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activesupport
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - '='
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 4.1.
|
19
|
+
version: 4.1.2.rc1
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - '='
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 4.1.
|
26
|
+
version: 4.1.2.rc1
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: activemodel
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - '='
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 4.1.
|
33
|
+
version: 4.1.2.rc1
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - '='
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 4.1.
|
40
|
+
version: 4.1.2.rc1
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: arel
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 5.0.0
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 5.0.0
|
62
55
|
description: Databases on Rails. Build a persistent domain model by mapping database
|
@@ -73,8 +66,10 @@ files:
|
|
73
66
|
- README.rdoc
|
74
67
|
- examples/performance.rb
|
75
68
|
- examples/simple.rb
|
69
|
+
- lib/active_record.rb
|
76
70
|
- lib/active_record/aggregations.rb
|
77
71
|
- lib/active_record/association_relation.rb
|
72
|
+
- lib/active_record/associations.rb
|
78
73
|
- lib/active_record/associations/alias_tracker.rb
|
79
74
|
- lib/active_record/associations/association.rb
|
80
75
|
- lib/active_record/associations/association_scope.rb
|
@@ -93,10 +88,11 @@ files:
|
|
93
88
|
- lib/active_record/associations/has_many_through_association.rb
|
94
89
|
- lib/active_record/associations/has_one_association.rb
|
95
90
|
- lib/active_record/associations/has_one_through_association.rb
|
91
|
+
- lib/active_record/associations/join_dependency.rb
|
96
92
|
- lib/active_record/associations/join_dependency/join_association.rb
|
97
93
|
- lib/active_record/associations/join_dependency/join_base.rb
|
98
94
|
- lib/active_record/associations/join_dependency/join_part.rb
|
99
|
-
- lib/active_record/associations/
|
95
|
+
- lib/active_record/associations/preloader.rb
|
100
96
|
- lib/active_record/associations/preloader/association.rb
|
101
97
|
- lib/active_record/associations/preloader/belongs_to.rb
|
102
98
|
- lib/active_record/associations/preloader/collection_association.rb
|
@@ -106,11 +102,10 @@ files:
|
|
106
102
|
- lib/active_record/associations/preloader/has_one_through.rb
|
107
103
|
- lib/active_record/associations/preloader/singular_association.rb
|
108
104
|
- lib/active_record/associations/preloader/through_association.rb
|
109
|
-
- lib/active_record/associations/preloader.rb
|
110
105
|
- lib/active_record/associations/singular_association.rb
|
111
106
|
- lib/active_record/associations/through_association.rb
|
112
|
-
- lib/active_record/associations.rb
|
113
107
|
- lib/active_record/attribute_assignment.rb
|
108
|
+
- lib/active_record/attribute_methods.rb
|
114
109
|
- lib/active_record/attribute_methods/before_type_cast.rb
|
115
110
|
- lib/active_record/attribute_methods/dirty.rb
|
116
111
|
- lib/active_record/attribute_methods/primary_key.rb
|
@@ -119,7 +114,6 @@ files:
|
|
119
114
|
- lib/active_record/attribute_methods/serialization.rb
|
120
115
|
- lib/active_record/attribute_methods/time_zone_conversion.rb
|
121
116
|
- lib/active_record/attribute_methods/write.rb
|
122
|
-
- lib/active_record/attribute_methods.rb
|
123
117
|
- lib/active_record/autosave_association.rb
|
124
118
|
- lib/active_record/base.rb
|
125
119
|
- lib/active_record/callbacks.rb
|
@@ -170,9 +164,9 @@ files:
|
|
170
164
|
- lib/active_record/locking/optimistic.rb
|
171
165
|
- lib/active_record/locking/pessimistic.rb
|
172
166
|
- lib/active_record/log_subscriber.rb
|
167
|
+
- lib/active_record/migration.rb
|
173
168
|
- lib/active_record/migration/command_recorder.rb
|
174
169
|
- lib/active_record/migration/join_table.rb
|
175
|
-
- lib/active_record/migration.rb
|
176
170
|
- lib/active_record/model_schema.rb
|
177
171
|
- lib/active_record/nested_attributes.rb
|
178
172
|
- lib/active_record/no_touching.rb
|
@@ -187,26 +181,26 @@ files:
|
|
187
181
|
- lib/active_record/railties/jdbcmysql_error.rb
|
188
182
|
- lib/active_record/readonly_attributes.rb
|
189
183
|
- lib/active_record/reflection.rb
|
184
|
+
- lib/active_record/relation.rb
|
190
185
|
- lib/active_record/relation/batches.rb
|
191
186
|
- lib/active_record/relation/calculations.rb
|
192
187
|
- lib/active_record/relation/delegation.rb
|
193
188
|
- lib/active_record/relation/finder_methods.rb
|
194
189
|
- lib/active_record/relation/merger.rb
|
190
|
+
- lib/active_record/relation/predicate_builder.rb
|
195
191
|
- lib/active_record/relation/predicate_builder/array_handler.rb
|
196
192
|
- lib/active_record/relation/predicate_builder/relation_handler.rb
|
197
|
-
- lib/active_record/relation/predicate_builder.rb
|
198
193
|
- lib/active_record/relation/query_methods.rb
|
199
194
|
- lib/active_record/relation/spawn_methods.rb
|
200
|
-
- lib/active_record/relation.rb
|
201
195
|
- lib/active_record/result.rb
|
202
196
|
- lib/active_record/runtime_registry.rb
|
203
197
|
- lib/active_record/sanitization.rb
|
204
198
|
- lib/active_record/schema.rb
|
205
199
|
- lib/active_record/schema_dumper.rb
|
206
200
|
- lib/active_record/schema_migration.rb
|
201
|
+
- lib/active_record/scoping.rb
|
207
202
|
- lib/active_record/scoping/default.rb
|
208
203
|
- lib/active_record/scoping/named.rb
|
209
|
-
- lib/active_record/scoping.rb
|
210
204
|
- lib/active_record/serialization.rb
|
211
205
|
- lib/active_record/serializers/xml_serializer.rb
|
212
206
|
- lib/active_record/statement_cache.rb
|
@@ -218,45 +212,43 @@ files:
|
|
218
212
|
- lib/active_record/timestamp.rb
|
219
213
|
- lib/active_record/transactions.rb
|
220
214
|
- lib/active_record/translation.rb
|
215
|
+
- lib/active_record/validations.rb
|
221
216
|
- lib/active_record/validations/associated.rb
|
222
217
|
- lib/active_record/validations/presence.rb
|
223
218
|
- lib/active_record/validations/uniqueness.rb
|
224
|
-
- lib/active_record/validations.rb
|
225
219
|
- lib/active_record/version.rb
|
226
|
-
- lib/active_record.rb
|
220
|
+
- lib/rails/generators/active_record.rb
|
221
|
+
- lib/rails/generators/active_record/migration.rb
|
227
222
|
- lib/rails/generators/active_record/migration/migration_generator.rb
|
228
223
|
- lib/rails/generators/active_record/migration/templates/create_table_migration.rb
|
229
224
|
- lib/rails/generators/active_record/migration/templates/migration.rb
|
230
|
-
- lib/rails/generators/active_record/migration.rb
|
231
225
|
- lib/rails/generators/active_record/model/model_generator.rb
|
232
226
|
- lib/rails/generators/active_record/model/templates/model.rb
|
233
227
|
- lib/rails/generators/active_record/model/templates/module.rb
|
234
|
-
- lib/rails/generators/active_record.rb
|
235
228
|
homepage: http://www.rubyonrails.org
|
236
229
|
licenses:
|
237
230
|
- MIT
|
231
|
+
metadata: {}
|
238
232
|
post_install_message:
|
239
233
|
rdoc_options:
|
240
|
-
- --main
|
234
|
+
- "--main"
|
241
235
|
- README.rdoc
|
242
236
|
require_paths:
|
243
237
|
- lib
|
244
238
|
required_ruby_version: !ruby/object:Gem::Requirement
|
245
|
-
none: false
|
246
239
|
requirements:
|
247
|
-
- -
|
240
|
+
- - ">="
|
248
241
|
- !ruby/object:Gem::Version
|
249
242
|
version: 1.9.3
|
250
243
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
251
|
-
none: false
|
252
244
|
requirements:
|
253
|
-
- -
|
245
|
+
- - ">"
|
254
246
|
- !ruby/object:Gem::Version
|
255
|
-
version:
|
247
|
+
version: 1.3.1
|
256
248
|
requirements: []
|
257
249
|
rubyforge_project:
|
258
|
-
rubygems_version:
|
250
|
+
rubygems_version: 2.2.2
|
259
251
|
signing_key:
|
260
|
-
specification_version:
|
252
|
+
specification_version: 4
|
261
253
|
summary: Object-relational mapper framework (part of Rails).
|
262
254
|
test_files: []
|