activerecord 4.2.0.rc1 → 4.2.0.rc2
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 +5 -0
- data/README.rdoc +1 -1
- data/lib/active_record/attribute_methods/dirty.rb +6 -6
- data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +2 -2
- data/lib/active_record/connection_adapters/abstract/schema_statements.rb +1 -1
- data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +1 -1
- data/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +19 -7
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +7 -4
- data/lib/active_record/core.rb +0 -1
- data/lib/active_record/gem_version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28b61291529e1647dc68f482c67cb982f1412b58
|
4
|
+
data.tar.gz: 5d284927108612f0bba531978c77f77ecb2ab173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53fae71b52ab612485bba69f354387d78b0a79cd5358488c3322f6e6efe38812b3467f903ba2b71c87774d7922a40935b8cd7a457423ec827cf288669a752fa7
|
7
|
+
data.tar.gz: bb77f7468870ad4497ddc1f42cf0a85ef38036a60297a80af4c506899fb28aa124cb87cc679b70d1bfd73d23e87791f1c03729a7bbc0b2e011707d4ba22db6cb
|
data/CHANGELOG.md
CHANGED
data/README.rdoc
CHANGED
@@ -192,7 +192,7 @@ The latest version of Active Record can be installed with RubyGems:
|
|
192
192
|
|
193
193
|
Source code can be downloaded as part of the Rails project on GitHub:
|
194
194
|
|
195
|
-
* https://github.com/rails/rails/tree/
|
195
|
+
* https://github.com/rails/rails/tree/4-2-stable/activerecord
|
196
196
|
|
197
197
|
|
198
198
|
== License
|
@@ -69,6 +69,11 @@ module ActiveRecord
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
+
def attribute_changed_in_place?(attr_name)
|
73
|
+
old_value = original_raw_attribute(attr_name)
|
74
|
+
@attributes[attr_name].changed_in_place_from?(old_value)
|
75
|
+
end
|
76
|
+
|
72
77
|
private
|
73
78
|
|
74
79
|
def calculate_changes_from_defaults
|
@@ -141,15 +146,10 @@ module ActiveRecord
|
|
141
146
|
|
142
147
|
def changed_in_place
|
143
148
|
self.class.attribute_names.select do |attr_name|
|
144
|
-
|
149
|
+
attribute_changed_in_place?(attr_name)
|
145
150
|
end
|
146
151
|
end
|
147
152
|
|
148
|
-
def changed_in_place?(attr_name)
|
149
|
-
old_value = original_raw_attribute(attr_name)
|
150
|
-
@attributes[attr_name].changed_in_place_from?(old_value)
|
151
|
-
end
|
152
|
-
|
153
153
|
def original_raw_attribute(attr_name)
|
154
154
|
original_raw_attributes.fetch(attr_name) do
|
155
155
|
read_attribute_before_type_cast(attr_name)
|
@@ -509,8 +509,8 @@ module ActiveRecord
|
|
509
509
|
# Removes the timestamp columns (+created_at+ and +updated_at+) from the table.
|
510
510
|
#
|
511
511
|
# t.remove_timestamps
|
512
|
-
def remove_timestamps
|
513
|
-
@base.remove_timestamps(name)
|
512
|
+
def remove_timestamps(options = {})
|
513
|
+
@base.remove_timestamps(name, options)
|
514
514
|
end
|
515
515
|
|
516
516
|
# Renames a column.
|
@@ -779,7 +779,7 @@ module ActiveRecord
|
|
779
779
|
[add_column_sql(table_name, :created_at, :datetime, options), add_column_sql(table_name, :updated_at, :datetime, options)]
|
780
780
|
end
|
781
781
|
|
782
|
-
def remove_timestamps_sql(table_name)
|
782
|
+
def remove_timestamps_sql(table_name, options = {})
|
783
783
|
[remove_column_sql(table_name, :updated_at), remove_column_sql(table_name, :created_at)]
|
784
784
|
end
|
785
785
|
|
@@ -39,14 +39,14 @@ module ActiveRecord
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def register_array_type(row)
|
42
|
-
|
43
|
-
|
42
|
+
register_with_subtype(row['oid'], row['typelem'].to_i) do |subtype|
|
43
|
+
OID::Array.new(subtype, row['typdelim'])
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
def register_range_type(row)
|
48
|
-
|
49
|
-
|
48
|
+
register_with_subtype(row['oid'], row['rngsubtype'].to_i) do |subtype|
|
49
|
+
OID::Range.new(subtype, row['typname'].to_sym)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -64,9 +64,13 @@ module ActiveRecord
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
def register(oid, oid_type)
|
68
|
-
oid = assert_valid_registration(oid, oid_type)
|
69
|
-
|
67
|
+
def register(oid, oid_type = nil, &block)
|
68
|
+
oid = assert_valid_registration(oid, oid_type || block)
|
69
|
+
if block_given?
|
70
|
+
@store.register_type(oid, &block)
|
71
|
+
else
|
72
|
+
@store.register_type(oid, oid_type)
|
73
|
+
end
|
70
74
|
end
|
71
75
|
|
72
76
|
def alias_type(oid, target)
|
@@ -74,6 +78,14 @@ module ActiveRecord
|
|
74
78
|
@store.alias_type(oid, target)
|
75
79
|
end
|
76
80
|
|
81
|
+
def register_with_subtype(oid, target_oid)
|
82
|
+
if @store.key?(target_oid)
|
83
|
+
register(oid) do |_, *args|
|
84
|
+
yield @store.lookup(target_oid, *args)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
77
89
|
def assert_valid_registration(oid, oid_type)
|
78
90
|
raise ArgumentError, "can't register nil type for OID #{oid}" if oid_type.nil?
|
79
91
|
oid.to_i
|
@@ -516,9 +516,12 @@ module ActiveRecord
|
|
516
516
|
|
517
517
|
def extract_limit(sql_type) # :nodoc:
|
518
518
|
case sql_type
|
519
|
-
when /^bigint/i
|
520
|
-
|
521
|
-
|
519
|
+
when /^bigint/i, /^int8/i
|
520
|
+
8
|
521
|
+
when /^smallint/i
|
522
|
+
2
|
523
|
+
else
|
524
|
+
super
|
522
525
|
end
|
523
526
|
end
|
524
527
|
|
@@ -532,7 +535,7 @@ module ActiveRecord
|
|
532
535
|
when 'true', 'false'
|
533
536
|
default
|
534
537
|
# Numeric types
|
535
|
-
when /\A\(?(-?\d+(\.\d*)
|
538
|
+
when /\A\(?(-?\d+(\.\d*)?)\)?(::bigint)?\z/
|
536
539
|
$1
|
537
540
|
# Object identifier types
|
538
541
|
when /\A-?\d+\z/
|
data/lib/active_record/core.rb
CHANGED
@@ -85,7 +85,6 @@ module ActiveRecord
|
|
85
85
|
mattr_accessor :dump_schema_after_migration, instance_writer: false
|
86
86
|
self.dump_schema_after_migration = true
|
87
87
|
|
88
|
-
# :nodoc:
|
89
88
|
mattr_accessor :maintain_test_schema, instance_accessor: false
|
90
89
|
|
91
90
|
def self.disable_implicit_join_references=(value)
|
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.2.0.
|
4
|
+
version: 4.2.0.rc2
|
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: 2014-
|
11
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,40 +16,40 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.2.0.
|
19
|
+
version: 4.2.0.rc2
|
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.2.0.
|
26
|
+
version: 4.2.0.rc2
|
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.2.0.
|
33
|
+
version: 4.2.0.rc2
|
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.2.0.
|
40
|
+
version: 4.2.0.rc2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: arel
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '6.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '6.0'
|
55
55
|
description: Databases on Rails. Build a persistent domain model by mapping database
|
@@ -285,23 +285,23 @@ licenses:
|
|
285
285
|
metadata: {}
|
286
286
|
post_install_message:
|
287
287
|
rdoc_options:
|
288
|
-
-
|
288
|
+
- --main
|
289
289
|
- README.rdoc
|
290
290
|
require_paths:
|
291
291
|
- lib
|
292
292
|
required_ruby_version: !ruby/object:Gem::Requirement
|
293
293
|
requirements:
|
294
|
-
- -
|
294
|
+
- - '>='
|
295
295
|
- !ruby/object:Gem::Version
|
296
296
|
version: 1.9.3
|
297
297
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
298
298
|
requirements:
|
299
|
-
- -
|
299
|
+
- - '>'
|
300
300
|
- !ruby/object:Gem::Version
|
301
301
|
version: 1.3.1
|
302
302
|
requirements: []
|
303
303
|
rubyforge_project:
|
304
|
-
rubygems_version: 2.2.
|
304
|
+
rubygems_version: 2.2.1
|
305
305
|
signing_key:
|
306
306
|
specification_version: 4
|
307
307
|
summary: Object-relational mapper framework (part of Rails).
|