activerecord 4.2.0 → 4.2.11
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 +5 -5
- data/CHANGELOG.md +657 -1
- data/lib/active_record.rb +3 -0
- data/lib/active_record/aggregations.rb +6 -3
- data/lib/active_record/association_relation.rb +13 -0
- data/lib/active_record/associations.rb +5 -4
- data/lib/active_record/associations/association.rb +15 -3
- data/lib/active_record/associations/association_scope.rb +1 -0
- data/lib/active_record/associations/belongs_to_association.rb +13 -5
- data/lib/active_record/associations/builder/association.rb +1 -1
- data/lib/active_record/associations/builder/collection_association.rb +5 -1
- data/lib/active_record/associations/builder/has_and_belongs_to_many.rb +8 -4
- data/lib/active_record/associations/collection_association.rb +35 -15
- data/lib/active_record/associations/collection_proxy.rb +15 -9
- data/lib/active_record/associations/foreign_association.rb +11 -0
- data/lib/active_record/associations/has_many_association.rb +30 -15
- data/lib/active_record/associations/has_many_through_association.rb +11 -2
- data/lib/active_record/associations/has_one_association.rb +1 -0
- data/lib/active_record/associations/join_dependency.rb +8 -2
- data/lib/active_record/associations/join_dependency/join_association.rb +7 -1
- data/lib/active_record/associations/preloader.rb +4 -4
- data/lib/active_record/associations/preloader/association.rb +5 -1
- data/lib/active_record/associations/singular_association.rb +2 -8
- data/lib/active_record/associations/through_association.rb +11 -6
- data/lib/active_record/attribute.rb +15 -1
- data/lib/active_record/attribute_assignment.rb +2 -2
- data/lib/active_record/attribute_methods.rb +4 -8
- data/lib/active_record/attribute_methods/before_type_cast.rb +5 -0
- data/lib/active_record/attribute_methods/dirty.rb +14 -4
- data/lib/active_record/attribute_methods/time_zone_conversion.rb +5 -1
- data/lib/active_record/attribute_methods/write.rb +1 -1
- data/lib/active_record/attribute_set.rb +4 -0
- data/lib/active_record/attribute_set/builder.rb +32 -12
- data/lib/active_record/attributes.rb +8 -0
- data/lib/active_record/autosave_association.rb +24 -9
- data/lib/active_record/base.rb +4 -5
- data/lib/active_record/callbacks.rb +1 -1
- data/lib/active_record/connection_adapters/abstract/connection_pool.rb +12 -6
- data/lib/active_record/connection_adapters/abstract/database_statements.rb +23 -3
- data/lib/active_record/connection_adapters/abstract/query_cache.rb +1 -1
- data/lib/active_record/connection_adapters/abstract/quoting.rb +1 -0
- data/lib/active_record/connection_adapters/abstract/savepoints.rb +1 -1
- data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +26 -16
- data/lib/active_record/connection_adapters/abstract/schema_statements.rb +87 -24
- data/lib/active_record/connection_adapters/abstract/transaction.rb +2 -6
- data/lib/active_record/connection_adapters/abstract_adapter.rb +25 -7
- data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +73 -10
- data/lib/active_record/connection_adapters/column.rb +2 -2
- data/lib/active_record/connection_adapters/mysql2_adapter.rb +7 -21
- data/lib/active_record/connection_adapters/mysql_adapter.rb +10 -3
- data/lib/active_record/connection_adapters/postgresql/database_statements.rb +1 -1
- data/lib/active_record/connection_adapters/postgresql/oid/array.rb +2 -1
- data/lib/active_record/connection_adapters/postgresql/oid/bytea.rb +1 -0
- data/lib/active_record/connection_adapters/postgresql/oid/date_time.rb +9 -0
- data/lib/active_record/connection_adapters/postgresql/oid/enum.rb +3 -1
- data/lib/active_record/connection_adapters/postgresql/oid/json.rb +1 -1
- data/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb +4 -0
- data/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +17 -5
- data/lib/active_record/connection_adapters/postgresql/schema_definitions.rb +3 -3
- data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +21 -13
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +12 -12
- data/lib/active_record/connection_adapters/sqlite3_adapter.rb +12 -28
- data/lib/active_record/connection_handling.rb +1 -1
- data/lib/active_record/core.rb +28 -15
- data/lib/active_record/counter_cache.rb +1 -1
- data/lib/active_record/enum.rb +2 -3
- data/lib/active_record/errors.rb +6 -5
- data/lib/active_record/explain_subscriber.rb +1 -1
- data/lib/active_record/fixtures.rb +9 -7
- data/lib/active_record/gem_version.rb +1 -1
- data/lib/active_record/legacy_yaml_adapter.rb +30 -0
- data/lib/active_record/locking/optimistic.rb +16 -14
- data/lib/active_record/migration.rb +38 -10
- data/lib/active_record/model_schema.rb +4 -2
- data/lib/active_record/nested_attributes.rb +13 -3
- data/lib/active_record/no_touching.rb +1 -1
- data/lib/active_record/persistence.rb +7 -4
- data/lib/active_record/railtie.rb +5 -3
- data/lib/active_record/railties/databases.rake +17 -24
- data/lib/active_record/reflection.rb +40 -28
- data/lib/active_record/relation.rb +3 -2
- data/lib/active_record/relation/calculations.rb +10 -3
- data/lib/active_record/relation/delegation.rb +1 -1
- data/lib/active_record/relation/finder_methods.rb +4 -16
- data/lib/active_record/relation/merger.rb +24 -1
- data/lib/active_record/relation/predicate_builder.rb +32 -3
- data/lib/active_record/relation/predicate_builder/array_handler.rb +3 -2
- data/lib/active_record/relation/query_methods.rb +29 -27
- data/lib/active_record/relation/spawn_methods.rb +7 -3
- data/lib/active_record/schema_dumper.rb +1 -1
- data/lib/active_record/schema_migration.rb +1 -4
- data/lib/active_record/scoping/default.rb +1 -0
- data/lib/active_record/tasks/database_tasks.rb +5 -2
- data/lib/active_record/tasks/mysql_database_tasks.rb +30 -16
- data/lib/active_record/tasks/postgresql_database_tasks.rb +19 -8
- data/lib/active_record/transactions.rb +21 -11
- data/lib/active_record/type/boolean.rb +1 -0
- data/lib/active_record/type/date.rb +4 -0
- data/lib/active_record/type/date_time.rb +14 -3
- data/lib/active_record/type/decimal.rb +27 -3
- data/lib/active_record/type/hash_lookup_type_map.rb +8 -2
- data/lib/active_record/type/integer.rb +9 -5
- data/lib/active_record/type/numeric.rb +1 -1
- data/lib/active_record/type/serialized.rb +7 -1
- data/lib/active_record/type/string.rb +4 -0
- data/lib/active_record/type/value.rb +9 -0
- data/lib/active_record/validations/uniqueness.rb +16 -6
- data/lib/rails/generators/active_record/migration/templates/create_table_migration.rb +0 -3
- data/lib/rails/generators/active_record/migration/templates/migration.rb +0 -6
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b4eb57706322cba941ba97d4a7254efc6fbb0a593eb527bf99006d0f1297fe51
|
4
|
+
data.tar.gz: c754d369c3866369f08bca6fcdff735ad1378d48cf57f359b7680b748fcd23b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db1bd8584e865afbdb71c442d461c3e9f0d25514d8f8db44321edc9ec46ef69f4fa923d1ad8acae65b79160bf26935e2de68f3bf2e014bca4d82c80d597dbb9a
|
7
|
+
data.tar.gz: 7ae5dd843b1c73cd74578a1a3245fcb05c2c293e1db8b143f1895e1c2b821a22217e8a00b2e4088df3e64ef638d80ac0f1050900839a69762a56051a0baf0089
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,659 @@
|
|
1
|
+
## Rails 4.2.11 (November 27, 2018) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 4.2.10 (September 27, 2017) ##
|
7
|
+
|
8
|
+
* `Relation#joins` is no longer affected by the target model's
|
9
|
+
`current_scope`, with the exception of `unscoped`.
|
10
|
+
|
11
|
+
Fixes #29338.
|
12
|
+
|
13
|
+
*Sean Griffin*
|
14
|
+
|
15
|
+
## Rails 4.2.9 (June 26, 2017) ##
|
16
|
+
|
17
|
+
* Fix regression caused by `collection_singular_ids=` ignoring different primary key on relationship.
|
18
|
+
|
19
|
+
*Nick Pezza*
|
20
|
+
|
21
|
+
* Fix `rake db:schema:load` with subdirectories.
|
22
|
+
|
23
|
+
*Ryuta Kamizono*
|
24
|
+
|
25
|
+
* Fix `rake db:migrate:status` with subdirectories.
|
26
|
+
|
27
|
+
*Ryuta Kamizono*
|
28
|
+
|
29
|
+
* Fix regression of #1969 with SELECT aliases in HAVING clause.
|
30
|
+
|
31
|
+
*Eugene Kenny*
|
32
|
+
|
33
|
+
* Fix `wait_timeout` to configurable for mysql2 adapter.
|
34
|
+
|
35
|
+
Fixes #26556.
|
36
|
+
|
37
|
+
*Ryuta Kamizono*
|
38
|
+
|
39
|
+
* Make `table_name=` reset current statement cache,
|
40
|
+
so queries are not run against the previous table name.
|
41
|
+
|
42
|
+
*namusyaka*
|
43
|
+
|
44
|
+
|
45
|
+
## Rails 4.2.8 (February 21, 2017) ##
|
46
|
+
|
47
|
+
* Using a mysql2 connection after it fails to reconnect will now have an error message
|
48
|
+
saying the connection is closed rather than an undefined method error message.
|
49
|
+
|
50
|
+
*Dylan Thacker-Smith*
|
51
|
+
|
52
|
+
* Bust Model.attribute_names cache when resetting column information
|
53
|
+
|
54
|
+
*James Coleman*
|
55
|
+
|
56
|
+
* Fix query caching when type information is reset
|
57
|
+
|
58
|
+
Backports ancillary fix in 5.0.
|
59
|
+
|
60
|
+
*James Coleman*
|
61
|
+
|
62
|
+
* Allow `joins` to be unscoped.
|
63
|
+
|
64
|
+
Fixes #13775.
|
65
|
+
|
66
|
+
*Takashi Kokubun*
|
67
|
+
|
68
|
+
* Hashes can once again be passed to setters of `composed_of`, if all of the
|
69
|
+
mapping methods are methods implemented on `Hash`.
|
70
|
+
|
71
|
+
Fixes #25978.
|
72
|
+
|
73
|
+
*Sean Griffin*
|
74
|
+
|
75
|
+
|
76
|
+
## Rails 4.2.7 (July 12, 2016) ##
|
77
|
+
|
78
|
+
* Inspecting an object with an associated array of over 10 elements no longer
|
79
|
+
truncates the array, preventing `inspect` from looping infinitely in some
|
80
|
+
cases.
|
81
|
+
|
82
|
+
*Kevin McPhillips*
|
83
|
+
|
84
|
+
* Ensure hashes can be assigned to attributes created using `composed_of`.
|
85
|
+
Fixes #25210.
|
86
|
+
|
87
|
+
*Sean Griffin*
|
88
|
+
|
89
|
+
* Queries such as `Computer.joins(:monitor).group(:status).count` will now be
|
90
|
+
interpreted as `Computer.joins(:monitor).group('computers.status').count`
|
91
|
+
so that when `Computer` and `Monitor` have both `status` columns we don't
|
92
|
+
have conflicts in projection.
|
93
|
+
|
94
|
+
*Rafael Sales*
|
95
|
+
|
96
|
+
* ActiveRecord::Relation#count: raise an ArgumentError when finder options
|
97
|
+
are specified or an ActiveRecord::StatementInvalid when an invalid type
|
98
|
+
is provided for a column name (e.g. a Hash).
|
99
|
+
|
100
|
+
Fixes #20434
|
101
|
+
|
102
|
+
*Konstantinos Rousis*
|
103
|
+
|
104
|
+
* Correctly pass MySQL options when using structure_dump or structure_load
|
105
|
+
|
106
|
+
Specifically, it fixes an issue when using SSL authentication.
|
107
|
+
|
108
|
+
*Alex Coomans*
|
109
|
+
|
110
|
+
|
111
|
+
## Rails 4.2.6 (March 07, 2016) ##
|
112
|
+
|
113
|
+
* Fix a bug where using `t.foreign_key` twice with the same `to_table` within
|
114
|
+
the same table definition would only create one foreign key.
|
115
|
+
|
116
|
+
*George Millo*
|
117
|
+
|
118
|
+
* Fix regression in dirty attribute tracking after #dup. Changes to the
|
119
|
+
clone no longer show as changed attributes in the original object.
|
120
|
+
|
121
|
+
*Dominic Cleal*
|
122
|
+
|
123
|
+
* Fix regression when loading fixture files with symbol keys.
|
124
|
+
|
125
|
+
Closes #22584.
|
126
|
+
|
127
|
+
*Yves Senn*
|
128
|
+
|
129
|
+
* Fix `rake db:structure:dump` on Postgres when multiple schemas are used.
|
130
|
+
|
131
|
+
Fixes #22346.
|
132
|
+
|
133
|
+
*Nick Muerdter*, *ckoenig*
|
134
|
+
|
135
|
+
* Introduce `connection.data_sources` and `connection.data_source_exists?`.
|
136
|
+
These methods determine what relations can be used to back Active Record
|
137
|
+
models (usually tables and views).
|
138
|
+
|
139
|
+
*Yves Senn*, *Matthew Draper*
|
140
|
+
|
141
|
+
|
142
|
+
## Rails 4.2.5.2 (February 26, 2016) ##
|
143
|
+
|
144
|
+
* No changes.
|
145
|
+
|
146
|
+
|
147
|
+
## Rails 4.2.5.1 (January 25, 2015) ##
|
148
|
+
|
149
|
+
* No changes.
|
150
|
+
|
151
|
+
|
152
|
+
## Rails 4.2.5 (November 12, 2015) ##
|
153
|
+
|
154
|
+
* No longer pass deprecated option `-i` to `pg_dump`.
|
155
|
+
|
156
|
+
*Paul Sadauskas*
|
157
|
+
|
158
|
+
* Set `scope.reordering_value` to `true` if :reordering values are specified.
|
159
|
+
|
160
|
+
Fixes #21886.
|
161
|
+
|
162
|
+
*Hiroaki Izu*
|
163
|
+
|
164
|
+
* Avoid disabling errors on the PostgreSQL connection when enabling the
|
165
|
+
standard_conforming_strings setting. Errors were previously disabled because
|
166
|
+
the setting wasn't writable in Postgres 8.1 and didn't exist in earlier
|
167
|
+
versions. Now Rails only supports Postgres 8.2+ we're fine to assume the
|
168
|
+
setting exists. Disabling errors caused problems when using a connection
|
169
|
+
pooling tool like PgBouncer because it's not guaranteed to have the same
|
170
|
+
connection between calls to `execute` and it could leave the connection
|
171
|
+
with errors disabled.
|
172
|
+
|
173
|
+
Fixes #22101.
|
174
|
+
|
175
|
+
*Harry Marr*
|
176
|
+
|
177
|
+
* Includes HABTM returns correct size now. It's caused by the join dependency
|
178
|
+
only instantiates one HABTM object because the join table hasn't a primary key.
|
179
|
+
|
180
|
+
Fixes #16032.
|
181
|
+
|
182
|
+
Examples:
|
183
|
+
|
184
|
+
before:
|
185
|
+
|
186
|
+
Project.first.salaried_developers.size # => 3
|
187
|
+
Project.includes(:salaried_developers).first.salaried_developers.size # => 1
|
188
|
+
|
189
|
+
after:
|
190
|
+
|
191
|
+
Project.first.salaried_developers.size # => 3
|
192
|
+
Project.includes(:salaried_developers).first.salaried_developers.size # => 3
|
193
|
+
|
194
|
+
*Bigxiang*
|
195
|
+
|
196
|
+
* Descriptive error message when fixtures contain a missing column.
|
197
|
+
|
198
|
+
Closes #21201.
|
199
|
+
|
200
|
+
*Yves Senn*
|
201
|
+
|
202
|
+
* `bin/rake db:migrate` uses
|
203
|
+
`ActiveRecord::Tasks::DatabaseTasks.migrations_paths` instead of
|
204
|
+
`Migrator.migrations_paths`.
|
205
|
+
|
206
|
+
*Tobias Bielohlawek*
|
207
|
+
|
208
|
+
* Fix `rewhere` in a `has_many` association.
|
209
|
+
|
210
|
+
Fixes #21955.
|
211
|
+
|
212
|
+
*Josh Branchaud*, *Kal*
|
213
|
+
|
214
|
+
* Added run_cmd class method to ActiveRecord::Tasks::DatabaseTasks for
|
215
|
+
drying up Kernel.system() calls within this namespace and to avoid
|
216
|
+
shell expansion by using a paramter list instead of string as arguments
|
217
|
+
for Kernel.system(). Thanks to Nate Berkopec for supply patch to get
|
218
|
+
test units passing.
|
219
|
+
|
220
|
+
*Bryan Paxton*
|
221
|
+
|
222
|
+
* Avoid leaking the first relation we call `first` on, per model.
|
223
|
+
|
224
|
+
Fixes #21921.
|
225
|
+
|
226
|
+
*Matthew Draper*, *Jean Boussier*
|
227
|
+
|
228
|
+
* Allow deserialization of Active Record models that were YAML encoded prior
|
229
|
+
to Rails 4.2
|
230
|
+
|
231
|
+
*Sean Griffin*
|
232
|
+
|
233
|
+
* Correctly apply `unscope` when preloading through associations.
|
234
|
+
|
235
|
+
*Jimmy Bourassa*
|
236
|
+
|
237
|
+
* Ensure `select` quotes aliased attributes, even when using `from`.
|
238
|
+
|
239
|
+
Fixes #21488
|
240
|
+
|
241
|
+
*Sean Griffin & @johanlunds*
|
242
|
+
|
243
|
+
* Correct query for PostgreSQL 8.2 compatibility.
|
244
|
+
|
245
|
+
*Ben Murphy*, *Matthew Draper*
|
246
|
+
|
247
|
+
* Uniqueness validator raises descriptive error when running on a persisted
|
248
|
+
record without primary key.
|
249
|
+
|
250
|
+
Closes #21304.
|
251
|
+
|
252
|
+
*Yves Senn*
|
253
|
+
|
254
|
+
|
255
|
+
## Rails 4.2.4 (August 24, 2015) ##
|
256
|
+
|
257
|
+
* Skip statement cache on through association reader.
|
258
|
+
|
259
|
+
If the through class has default scopes we should skip the statement
|
260
|
+
cache.
|
261
|
+
|
262
|
+
Closes #20745.
|
263
|
+
|
264
|
+
*Rafael Mendonça França*
|
265
|
+
|
266
|
+
* Fixes #19420. When generating schema.rb using Postgres BigInt[] data type
|
267
|
+
the limit: 8 was not coming through. This caused it to become Int[] data type
|
268
|
+
after doing a rebuild off of schema.rb.
|
269
|
+
|
270
|
+
*Jake Waller*
|
271
|
+
|
272
|
+
* Fix state being carried over from previous transaction.
|
273
|
+
|
274
|
+
Considering the following example where `name` is a required attribute.
|
275
|
+
Before we had `new_record?` returning `true` for a persisted record:
|
276
|
+
|
277
|
+
author = Author.create! name: 'foo'
|
278
|
+
author.name = nil
|
279
|
+
author.save # => false
|
280
|
+
author.new_record? # => true
|
281
|
+
|
282
|
+
Fixes #20824.
|
283
|
+
|
284
|
+
*Roque Pinel*
|
285
|
+
|
286
|
+
* Correctly ignore `mark_for_destruction` when `autosave` isn't set to `true`
|
287
|
+
when validating associations.
|
288
|
+
|
289
|
+
Fixes #20882.
|
290
|
+
|
291
|
+
*Sean Griffin*
|
292
|
+
|
293
|
+
* Fix through associations using scopes having the scope merged multiple
|
294
|
+
times.
|
295
|
+
|
296
|
+
Fixes #20721.
|
297
|
+
Fixes #20727.
|
298
|
+
|
299
|
+
*Sean Griffin*
|
300
|
+
|
301
|
+
* `ActiveRecord::Base.dump_schema_after_migration` applies migration tasks
|
302
|
+
other than `db:migrate`. (eg. `db:rollback`, `db:migrate:dup`, ...)
|
303
|
+
|
304
|
+
Fixes #20743.
|
305
|
+
|
306
|
+
*Yves Senn*
|
307
|
+
|
308
|
+
* Correctly raise `ActiveRecord::AssociationTypeMismatch` when assigning
|
309
|
+
a wrong type to a namespaced association.
|
310
|
+
|
311
|
+
Fixes #20545.
|
312
|
+
|
313
|
+
*Diego Carrion*
|
314
|
+
|
315
|
+
* Prevent error when using `force_reload: true` on an unassigned polymorphic
|
316
|
+
belongs_to association.
|
317
|
+
|
318
|
+
Fixes #20426.
|
319
|
+
|
320
|
+
*James Dabbs*
|
321
|
+
|
322
|
+
|
323
|
+
## Rails 4.2.3 (June 25, 2015) ##
|
324
|
+
|
325
|
+
* Let `WITH` queries (Common Table Expressions) be explainable.
|
326
|
+
|
327
|
+
*Vladimir Kochnev*
|
328
|
+
|
329
|
+
* Fix n+1 query problem when eager loading nil associations (fixes #18312)
|
330
|
+
|
331
|
+
*Sammy Larbi*
|
332
|
+
|
333
|
+
* Fixed an error which would occur in dirty checking when calling
|
334
|
+
`update_attributes` from a getter.
|
335
|
+
|
336
|
+
Fixes #20531.
|
337
|
+
|
338
|
+
*Sean Griffin*
|
339
|
+
|
340
|
+
* Ensure symbols passed to `ActiveRecord::Relation#select` are always treated
|
341
|
+
as columns.
|
342
|
+
|
343
|
+
Fixes #20360.
|
344
|
+
|
345
|
+
*Sean Griffin*
|
346
|
+
|
347
|
+
* Clear query cache when `ActiveRecord::Base#reload` is called.
|
348
|
+
|
349
|
+
*Shane Hender*
|
350
|
+
|
351
|
+
* Pass `:extend` option for `has_and_belongs_to_many` associations to the
|
352
|
+
underlying `has_many :through`.
|
353
|
+
|
354
|
+
*Jaehyun Shin*
|
355
|
+
|
356
|
+
* Make `unscope` aware of "less than" and "greater than" conditions.
|
357
|
+
|
358
|
+
*TAKAHASHI Kazuaki*
|
359
|
+
|
360
|
+
* Revert behavior of `db:schema:load` back to loading the full
|
361
|
+
environment. This ensures that initializers are run.
|
362
|
+
|
363
|
+
Fixes #19545.
|
364
|
+
|
365
|
+
*Yves Senn*
|
366
|
+
|
367
|
+
* Fix missing index when using `timestamps` with the `index` option.
|
368
|
+
|
369
|
+
The `index` option used with `timestamps` should be passed to both
|
370
|
+
`column` definitions for `created_at` and `updated_at` rather than just
|
371
|
+
the first.
|
372
|
+
|
373
|
+
*Paul Mucur*
|
374
|
+
|
375
|
+
* Rename `:class` to `:anonymous_class` in association options.
|
376
|
+
|
377
|
+
Fixes #19659.
|
378
|
+
|
379
|
+
*Andrew White*
|
380
|
+
|
381
|
+
* Fixed a bug where uniqueness validations would error on out of range values,
|
382
|
+
even if an validation should have prevented it from hitting the database.
|
383
|
+
|
384
|
+
*Andrey Voronkov*
|
385
|
+
|
386
|
+
* Foreign key related methods in the migration DSL respect
|
387
|
+
`ActiveRecord::Base.pluralize_table_names = false`.
|
388
|
+
|
389
|
+
Fixes #19643.
|
390
|
+
|
391
|
+
*Mehmet Emin İNAÇ*
|
392
|
+
|
393
|
+
* Reduce memory usage from loading types on pg.
|
394
|
+
|
395
|
+
Fixes #19578.
|
396
|
+
|
397
|
+
*Sean Griffin*
|
398
|
+
|
399
|
+
* Fix referencing wrong table aliases while joining tables of has many through
|
400
|
+
association (only when calling calculation methods).
|
401
|
+
|
402
|
+
Fixes #19276.
|
403
|
+
|
404
|
+
*pinglamb*
|
405
|
+
|
406
|
+
* Don't attempt to update counter caches, when the column wasn't selected.
|
407
|
+
|
408
|
+
Fixes #19437.
|
409
|
+
|
410
|
+
*Sean Griffin*
|
411
|
+
|
412
|
+
* Correctly persist a serialized attribute that has been returned to
|
413
|
+
its default value by an in-place modification.
|
414
|
+
|
415
|
+
Fixes #19467.
|
416
|
+
|
417
|
+
*Matthew Draper*
|
418
|
+
|
419
|
+
* Fix default `format` value in `ActiveRecord::Tasks::DatabaseTasks#schema_file`.
|
420
|
+
|
421
|
+
*James Cox*
|
422
|
+
|
423
|
+
* Dont enroll records in the transaction if they dont have commit callbacks.
|
424
|
+
That was causing a memory grow problem when creating a lot of records inside a transaction.
|
425
|
+
|
426
|
+
Fixes #15549.
|
427
|
+
|
428
|
+
*Will Bryant*, *Aaron Patterson*
|
429
|
+
|
430
|
+
* Correctly create through records when created on a has many through
|
431
|
+
association when using `where`.
|
432
|
+
|
433
|
+
Fixes #19073.
|
434
|
+
|
435
|
+
*Sean Griffin*
|
436
|
+
|
437
|
+
|
438
|
+
## Rails 4.2.2 (June 16, 2015) ##
|
439
|
+
|
440
|
+
* No Changes *
|
441
|
+
|
442
|
+
|
443
|
+
## Rails 4.2.1 (March 19, 2015) ##
|
444
|
+
|
445
|
+
* Fixed ActiveRecord::Relation#becomes! and changed_attributes issues for type column
|
446
|
+
|
447
|
+
Fixes #17139.
|
448
|
+
|
449
|
+
*Miklos Fazekas*
|
450
|
+
|
451
|
+
* `remove_reference` with `foreign_key: true` removes the foreign key before
|
452
|
+
removing the column. This fixes a bug where it was not possible to remove
|
453
|
+
the column on MySQL.
|
454
|
+
|
455
|
+
Fixes #18664.
|
456
|
+
|
457
|
+
*Yves Senn*
|
458
|
+
|
459
|
+
* Add a `:foreign_key` option to `references` and associated migration
|
460
|
+
methods. The model and migration generators now use this option, rather than
|
461
|
+
the `add_foreign_key` form.
|
462
|
+
|
463
|
+
*Sean Griffin*
|
464
|
+
|
465
|
+
* Fix rounding problem for PostgreSQL timestamp column.
|
466
|
+
|
467
|
+
If timestamp column have the precision, it need to format according to
|
468
|
+
the precision of timestamp column.
|
469
|
+
|
470
|
+
*Ryuta Kamizono*
|
471
|
+
|
472
|
+
* Respect the database default charset for `schema_migrations` table.
|
473
|
+
|
474
|
+
The charset of `version` column in `schema_migrations` table is depend
|
475
|
+
on the database default charset and collation rather than the encoding
|
476
|
+
of the connection.
|
477
|
+
|
478
|
+
*Ryuta Kamizono*
|
479
|
+
|
480
|
+
* Respect custom primary keys for associations when calling `Relation#where`
|
481
|
+
|
482
|
+
Fixes #18813.
|
483
|
+
|
484
|
+
*Sean Griffin*
|
485
|
+
|
486
|
+
* Fixed several edge cases which could result in a counter cache updating
|
487
|
+
twice or not updating at all for `has_many` and `has_many :through`.
|
488
|
+
|
489
|
+
Fixes #10865.
|
490
|
+
|
491
|
+
*Sean Griffin*
|
492
|
+
|
493
|
+
* Foreign keys added by migrations were given random, generated names. This
|
494
|
+
meant a different `structure.sql` would be generated every time a developer
|
495
|
+
ran migrations on their machine.
|
496
|
+
|
497
|
+
The generated part of foreign key names is now a hash of the table name and
|
498
|
+
column name, which is consistent every time you run the migration.
|
499
|
+
|
500
|
+
*Chris Sinjakli*
|
501
|
+
|
502
|
+
* Fixed ActiveRecord::Relation#group method when argument is SQL reserved key word:
|
503
|
+
|
504
|
+
SplitTest.group(:key).count
|
505
|
+
Property.group(:value).count
|
506
|
+
|
507
|
+
*Bogdan Gusiev*
|
508
|
+
|
509
|
+
* Don't define autosave association callbacks twice from
|
510
|
+
`accepts_nested_attributes_for`.
|
511
|
+
|
512
|
+
Fixes #18704.
|
513
|
+
|
514
|
+
*Sean Griffin*
|
515
|
+
|
516
|
+
* Integer types will no longer raise a `RangeError` when assigning an
|
517
|
+
attribute, but will instead raise when going to the database.
|
518
|
+
|
519
|
+
Fixes several vague issues which were never reported directly. See the
|
520
|
+
commit message from the commit which added this line for some examples.
|
521
|
+
|
522
|
+
*Sean Griffin*
|
523
|
+
|
524
|
+
* Values which would error while being sent to the database (such as an
|
525
|
+
ASCII-8BIT string with invalid UTF-8 bytes on Sqlite3), no longer error on
|
526
|
+
assignment. They will still error when sent to the database, but you are
|
527
|
+
given the ability to re-assign it to a valid value.
|
528
|
+
|
529
|
+
Fixes #18580.
|
530
|
+
|
531
|
+
*Sean Griffin*
|
532
|
+
|
533
|
+
* Don't remove join dependencies in `Relation#exists?`
|
534
|
+
|
535
|
+
Fixes #18632.
|
536
|
+
|
537
|
+
*Sean Griffin*
|
538
|
+
|
539
|
+
* Invalid values assigned to a JSON column are assumed to be `nil`.
|
540
|
+
|
541
|
+
Fixes #18629.
|
542
|
+
|
543
|
+
*Sean Griffin*
|
544
|
+
|
545
|
+
* No longer issue deprecation warning when including a scope with extensions.
|
546
|
+
Previously every scope with extension methods was transformed into an
|
547
|
+
instance dependent scope. Including such a scope would wrongfully issue a
|
548
|
+
deprecation warning. This is no longer the case.
|
549
|
+
|
550
|
+
Fixes #18467.
|
551
|
+
|
552
|
+
*Yves Senn*
|
553
|
+
|
554
|
+
* Correctly use the type provided by `serialize` when updating records using
|
555
|
+
optimistic locking.
|
556
|
+
|
557
|
+
Fixes #18385.
|
558
|
+
|
559
|
+
*Sean Griffin*
|
560
|
+
|
561
|
+
* `attribute_will_change!` will no longer cause non-persistable attributes to
|
562
|
+
be sent to the database.
|
563
|
+
|
564
|
+
Fixes #18407.
|
565
|
+
|
566
|
+
*Sean Griffin*
|
567
|
+
|
568
|
+
* Format the datetime string according to the precision of the datetime field.
|
569
|
+
|
570
|
+
Incompatible to rounding behavior between MySQL 5.6 and earlier.
|
571
|
+
|
572
|
+
In 5.5, when you insert `2014-08-17 12:30:00.999999` the fractional part
|
573
|
+
is ignored. In 5.6, it's rounded to `2014-08-17 12:30:01`:
|
574
|
+
|
575
|
+
http://bugs.mysql.com/bug.php?id=68760
|
576
|
+
|
577
|
+
*Ryuta Kamizono*
|
578
|
+
|
579
|
+
* Allow precision option for MySQL datetimes.
|
580
|
+
|
581
|
+
*Ryuta Kamizono*
|
582
|
+
|
583
|
+
* Clear query cache on rollback.
|
584
|
+
|
585
|
+
*Florian Weingarten*
|
586
|
+
|
587
|
+
* Fixed setting of foreign_key for through associations while building of new record.
|
588
|
+
|
589
|
+
Fixes #12698.
|
590
|
+
|
591
|
+
*Ivan Antropov*
|
592
|
+
|
593
|
+
* Fixed automatic inverse_of for models nested in module.
|
594
|
+
|
595
|
+
*Andrew McCloud*
|
596
|
+
|
597
|
+
* Fix `reaping_frequency` option when the value is a string.
|
598
|
+
|
599
|
+
This usually happens when it is configured using `DATABASE_URL`.
|
600
|
+
|
601
|
+
*korbin*
|
602
|
+
|
603
|
+
* Fix error message when trying to create an associated record and the foreign
|
604
|
+
key is missing.
|
605
|
+
|
606
|
+
Before this fix the following exception was being raised:
|
607
|
+
|
608
|
+
NoMethodError: undefined method `val' for #<Arel::Nodes::BindParam:0x007fc64d19c218>
|
609
|
+
|
610
|
+
Now the message is:
|
611
|
+
|
612
|
+
ActiveRecord::UnknownAttributeError: unknown attribute 'foreign_key' for Model.
|
613
|
+
|
614
|
+
*Rafael Mendonça França*
|
615
|
+
|
616
|
+
* Fix change detection problem for PostgreSQL bytea type and
|
617
|
+
`ArgumentError: string contains null byte` exception with pg-0.18.
|
618
|
+
|
619
|
+
Fixes #17680.
|
620
|
+
|
621
|
+
*Lars Kanis*
|
622
|
+
|
623
|
+
* When a table has a composite primary key, the `primary_key` method for
|
624
|
+
SQLite3 and PostgreSQL adapters was only returning the first field of the key.
|
625
|
+
Ensures that it will return nil instead, as Active Record doesn't support
|
626
|
+
composite primary keys.
|
627
|
+
|
628
|
+
Fixes #18070.
|
629
|
+
|
630
|
+
*arthurnn*
|
631
|
+
|
632
|
+
* Ensure `first!` and friends work on loaded associations.
|
633
|
+
|
634
|
+
Fixes #18237.
|
635
|
+
|
636
|
+
*Sean Griffin*
|
637
|
+
|
638
|
+
* Dump the default `nil` for PostgreSQL UUID primary key.
|
639
|
+
|
640
|
+
*Ryuta Kamizono*
|
641
|
+
|
642
|
+
* Don't raise when writing an attribute with an out-of-range datetime passed
|
643
|
+
by the user.
|
644
|
+
|
645
|
+
*Grey Baker*
|
646
|
+
|
647
|
+
* Fixes bug with 'ActiveRecord::Type::Numeric' that causes negative values to
|
648
|
+
be marked as having changed when set to the same negative value.
|
649
|
+
|
650
|
+
Fixes #18161.
|
651
|
+
|
652
|
+
*Daniel Fox*
|
653
|
+
|
654
|
+
|
655
|
+
## Rails 4.2.0 (December 20, 2014) ##
|
656
|
+
|
1
657
|
* Introduce `force: :cascade` option for `create_table`. Using this option
|
2
658
|
will recreate tables even if they have dependent objects (like foreign keys).
|
3
659
|
`db/schema.rb` now uses `force: :cascade`. This makes it possible to
|
@@ -9,7 +665,7 @@
|
|
9
665
|
before loading the schema. This is left for the user to do.
|
10
666
|
`db:test:prepare` will still purge the database.
|
11
667
|
|
12
|
-
|
668
|
+
Fixes #17945.
|
13
669
|
|
14
670
|
*Yves Senn*
|
15
671
|
|