activerecord 5.1.0.beta1 → 5.1.0.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.

Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +93 -6
  3. data/lib/active_record/associations.rb +4 -0
  4. data/lib/active_record/associations/association_scope.rb +8 -8
  5. data/lib/active_record/associations/belongs_to_association.rb +4 -0
  6. data/lib/active_record/associations/builder/belongs_to.rb +8 -1
  7. data/lib/active_record/associations/collection_proxy.rb +5 -4
  8. data/lib/active_record/associations/join_dependency.rb +1 -1
  9. data/lib/active_record/associations/join_dependency/join_association.rb +4 -23
  10. data/lib/active_record/attribute_methods/dirty.rb +3 -3
  11. data/lib/active_record/connection_adapters/abstract/quoting.rb +20 -3
  12. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +3 -7
  13. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +30 -16
  14. data/lib/active_record/connection_adapters/abstract_adapter.rb +8 -5
  15. data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +16 -80
  16. data/lib/active_record/connection_adapters/mysql/schema_statements.rb +33 -0
  17. data/lib/active_record/connection_adapters/mysql/type_metadata.rb +2 -0
  18. data/lib/active_record/connection_adapters/postgresql/oid/array.rb +1 -1
  19. data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +56 -96
  20. data/lib/active_record/connection_adapters/postgresql/type_metadata.rb +2 -0
  21. data/lib/active_record/connection_adapters/postgresql_adapter.rb +4 -12
  22. data/lib/active_record/connection_adapters/sqlite3/schema_statements.rb +32 -0
  23. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +4 -51
  24. data/lib/active_record/core.rb +0 -1
  25. data/lib/active_record/gem_version.rb +1 -1
  26. data/lib/active_record/locking/optimistic.rb +2 -6
  27. data/lib/active_record/migration.rb +32 -17
  28. data/lib/active_record/null_relation.rb +1 -1
  29. data/lib/active_record/querying.rb +1 -1
  30. data/lib/active_record/railties/databases.rake +3 -19
  31. data/lib/active_record/reflection.rb +67 -16
  32. data/lib/active_record/relation.rb +0 -4
  33. data/lib/active_record/relation/calculations.rb +7 -10
  34. data/lib/active_record/relation/delegation.rb +2 -2
  35. data/lib/active_record/relation/finder_methods.rb +102 -100
  36. data/lib/active_record/relation/query_methods.rb +6 -1
  37. data/lib/active_record/result.rb +12 -1
  38. data/lib/active_record/sanitization.rb +1 -2
  39. data/lib/active_record/schema_dumper.rb +1 -1
  40. data/lib/active_record/schema_migration.rb +5 -1
  41. data/lib/active_record/tasks/postgresql_database_tasks.rb +20 -0
  42. data/lib/active_record/transactions.rb +1 -1
  43. data/lib/active_record/type/decimal_without_scale.rb +4 -0
  44. data/lib/active_record/type/serialized.rb +2 -0
  45. data/lib/rails/generators/active_record/migration.rb +1 -1
  46. metadata +8 -6
@@ -283,7 +283,7 @@ module ActiveRecord
283
283
  fire_on = Array(options[:on])
284
284
  assert_valid_transaction_action(fire_on)
285
285
  options[:if] = Array(options[:if])
286
- options[:if] << "transaction_include_any_action?(#{fire_on})"
286
+ options[:if].unshift("transaction_include_any_action?(#{fire_on})")
287
287
  end
288
288
  end
289
289
 
@@ -4,6 +4,10 @@ module ActiveRecord
4
4
  def type
5
5
  :decimal
6
6
  end
7
+
8
+ def type_cast_for_schema(value)
9
+ value.to_s.inspect
10
+ end
7
11
  end
8
12
  end
9
13
  end
@@ -1,6 +1,8 @@
1
1
  module ActiveRecord
2
2
  module Type
3
3
  class Serialized < DelegateClass(ActiveModel::Type::Value) # :nodoc:
4
+ undef to_yaml if method_defined?(:to_yaml)
5
+
4
6
  include ActiveModel::Type::Helpers::Mutable
5
7
 
6
8
  attr_reader :subtype, :coder
@@ -22,7 +22,7 @@ module ActiveRecord
22
22
  end
23
23
 
24
24
  def db_migrate_path
25
- if defined?(Rails) && Rails.application
25
+ if defined?(Rails.application) && Rails.application
26
26
  Rails.application.config.paths["db/migrate"].to_ary.first
27
27
  else
28
28
  "db/migrate"
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: 5.1.0.beta1
4
+ version: 5.1.0.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: 2017-02-23 00:00:00.000000000 Z
11
+ date: 2017-03-20 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: 5.1.0.beta1
19
+ version: 5.1.0.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: 5.1.0.beta1
26
+ version: 5.1.0.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: 5.1.0.beta1
33
+ version: 5.1.0.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: 5.1.0.beta1
40
+ version: 5.1.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: arel
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -152,6 +152,7 @@ files:
152
152
  - lib/active_record/connection_adapters/mysql/schema_creation.rb
153
153
  - lib/active_record/connection_adapters/mysql/schema_definitions.rb
154
154
  - lib/active_record/connection_adapters/mysql/schema_dumper.rb
155
+ - lib/active_record/connection_adapters/mysql/schema_statements.rb
155
156
  - lib/active_record/connection_adapters/mysql/type_metadata.rb
156
157
  - lib/active_record/connection_adapters/mysql2_adapter.rb
157
158
  - lib/active_record/connection_adapters/postgresql/column.rb
@@ -196,6 +197,7 @@ files:
196
197
  - lib/active_record/connection_adapters/sqlite3/schema_creation.rb
197
198
  - lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
198
199
  - lib/active_record/connection_adapters/sqlite3/schema_dumper.rb
200
+ - lib/active_record/connection_adapters/sqlite3/schema_statements.rb
199
201
  - lib/active_record/connection_adapters/sqlite3_adapter.rb
200
202
  - lib/active_record/connection_adapters/statement_pool.rb
201
203
  - lib/active_record/connection_handling.rb