activerecord 4.0.0 → 4.0.1
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 +326 -3
- data/README.rdoc +1 -1
- data/lib/active_record/association_relation.rb +18 -0
- data/lib/active_record/associations/association.rb +11 -3
- data/lib/active_record/associations/builder/belongs_to.rb +4 -2
- data/lib/active_record/associations/collection_association.rb +8 -8
- data/lib/active_record/associations/collection_proxy.rb +2 -4
- data/lib/active_record/associations/has_many_association.rb +2 -2
- data/lib/active_record/associations/has_one_association.rb +3 -1
- data/lib/active_record/associations/join_dependency/join_association.rb +2 -0
- data/lib/active_record/associations/join_dependency/join_part.rb +14 -1
- data/lib/active_record/associations/preloader.rb +3 -2
- data/lib/active_record/attribute_methods/read.rb +15 -9
- data/lib/active_record/attribute_methods/time_zone_conversion.rb +1 -1
- data/lib/active_record/attribute_methods/write.rb +2 -0
- data/lib/active_record/attribute_methods.rb +26 -2
- data/lib/active_record/autosave_association.rb +8 -8
- data/lib/active_record/callbacks.rb +4 -1
- data/lib/active_record/connection_adapters/abstract/database_statements.rb +7 -7
- data/lib/active_record/connection_adapters/abstract/schema_statements.rb +12 -3
- data/lib/active_record/connection_adapters/abstract_adapter.rb +16 -2
- data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +3 -1
- data/lib/active_record/connection_adapters/column.rb +12 -11
- data/lib/active_record/connection_adapters/mysql2_adapter.rb +9 -3
- data/lib/active_record/connection_adapters/mysql_adapter.rb +19 -9
- data/lib/active_record/connection_adapters/postgresql/cast.rb +1 -1
- data/lib/active_record/connection_adapters/postgresql/database_statements.rb +7 -6
- data/lib/active_record/connection_adapters/postgresql/oid.rb +5 -0
- data/lib/active_record/connection_adapters/postgresql/quoting.rb +2 -0
- data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +7 -10
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +19 -13
- data/lib/active_record/connection_adapters/sqlite3_adapter.rb +8 -5
- data/lib/active_record/core.rb +18 -18
- data/lib/active_record/dynamic_matchers.rb +1 -1
- data/lib/active_record/fixtures.rb +2 -2
- data/lib/active_record/locking/optimistic.rb +1 -1
- data/lib/active_record/migration/command_recorder.rb +4 -1
- data/lib/active_record/migration.rb +1 -1
- data/lib/active_record/model_schema.rb +27 -17
- data/lib/active_record/null_relation.rb +1 -5
- data/lib/active_record/persistence.rb +16 -5
- data/lib/active_record/railtie.rb +1 -0
- data/lib/active_record/railties/databases.rake +4 -1
- data/lib/active_record/reflection.rb +1 -1
- data/lib/active_record/relation/batches.rb +2 -2
- data/lib/active_record/relation/calculations.rb +1 -0
- data/lib/active_record/relation/finder_methods.rb +10 -10
- data/lib/active_record/relation/merger.rb +31 -28
- data/lib/active_record/relation/query_methods.rb +20 -11
- data/lib/active_record/relation.rb +1 -1
- data/lib/active_record/result.rb +15 -1
- data/lib/active_record/sanitization.rb +13 -3
- data/lib/active_record/schema_dumper.rb +5 -1
- data/lib/active_record/tasks/database_tasks.rb +2 -1
- data/lib/active_record/tasks/sqlite_database_tasks.rb +1 -1
- data/lib/active_record/transactions.rb +5 -5
- data/lib/active_record/validations/uniqueness.rb +2 -2
- data/lib/active_record/version.rb +1 -1
- data/lib/active_record.rb +1 -0
- metadata +8 -7
@@ -243,7 +243,7 @@ module ActiveRecord
|
|
243
243
|
if options.is_a?(Hash) && options[:on]
|
244
244
|
assert_valid_transaction_action(options[:on])
|
245
245
|
options[:if] = Array(options[:if])
|
246
|
-
fire_on = Array(options[:on])
|
246
|
+
fire_on = Array(options[:on])
|
247
247
|
options[:if] << "transaction_include_any_action?(#{fire_on})"
|
248
248
|
end
|
249
249
|
end
|
@@ -286,17 +286,17 @@ module ActiveRecord
|
|
286
286
|
clear_transaction_record_state
|
287
287
|
end
|
288
288
|
|
289
|
-
# Call the after_commit callbacks
|
289
|
+
# Call the +after_commit+ callbacks.
|
290
290
|
#
|
291
291
|
# Ensure that it is not called if the object was never persisted (failed create),
|
292
|
-
# but call it after the commit of a destroyed object
|
292
|
+
# but call it after the commit of a destroyed object.
|
293
293
|
def committed! #:nodoc:
|
294
294
|
run_callbacks :commit if destroyed? || persisted?
|
295
295
|
ensure
|
296
296
|
clear_transaction_record_state
|
297
297
|
end
|
298
298
|
|
299
|
-
# Call the
|
299
|
+
# Call the +after_rollback+ callbacks. The +force_restore_state+ argument indicates if the record
|
300
300
|
# state should be rolled back to the beginning or just to the last savepoint.
|
301
301
|
def rolledback!(force_restore_state = false) #:nodoc:
|
302
302
|
run_callbacks :rollback
|
@@ -304,7 +304,7 @@ module ActiveRecord
|
|
304
304
|
restore_transaction_record_state(force_restore_state)
|
305
305
|
end
|
306
306
|
|
307
|
-
# Add the record to the current transaction so that the
|
307
|
+
# Add the record to the current transaction so that the +after_rollback+ and +after_commit+ callbacks
|
308
308
|
# can be called.
|
309
309
|
def add_to_transaction
|
310
310
|
if self.class.connection.add_transaction_record(self)
|
@@ -202,8 +202,8 @@ module ActiveRecord
|
|
202
202
|
# will result in the default Rails exception page being shown), or you
|
203
203
|
# can catch it and restart the transaction (e.g. by telling the user
|
204
204
|
# that the title already exists, and asking him to re-enter the title).
|
205
|
-
# This technique is also known as
|
206
|
-
# http://en.wikipedia.org/wiki/Optimistic_concurrency_control.
|
205
|
+
# This technique is also known as
|
206
|
+
# {optimistic concurrency control}[http://en.wikipedia.org/wiki/Optimistic_concurrency_control].
|
207
207
|
#
|
208
208
|
# The bundled ActiveRecord::ConnectionAdapters distinguish unique index
|
209
209
|
# constraint errors from other types of database errors by throwing an
|
data/lib/active_record.rb
CHANGED
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.0.
|
4
|
+
version: 4.0.1
|
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: 2013-
|
11
|
+
date: 2013-11-01 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.0.
|
19
|
+
version: 4.0.1
|
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.0.
|
26
|
+
version: 4.0.1
|
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.0.
|
33
|
+
version: 4.0.1
|
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.0.
|
40
|
+
version: 4.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: arel
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- examples/performance.rb
|
82
82
|
- examples/simple.rb
|
83
83
|
- lib/active_record/aggregations.rb
|
84
|
+
- lib/active_record/association_relation.rb
|
84
85
|
- lib/active_record/associations/alias_tracker.rb
|
85
86
|
- lib/active_record/associations/association.rb
|
86
87
|
- lib/active_record/associations/association_scope.rb
|
@@ -259,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
260
|
version: '0'
|
260
261
|
requirements: []
|
261
262
|
rubyforge_project:
|
262
|
-
rubygems_version: 2.0.
|
263
|
+
rubygems_version: 2.0.3
|
263
264
|
signing_key:
|
264
265
|
specification_version: 4
|
265
266
|
summary: Object-relational mapper framework (part of Rails).
|