Deprecate passing arguments and block at the same time to
Optimistic locking: Added ability update locking_column value. Ignore optimistic locking if update with new locking_column value.
Fixed: Optimistic locking does not work well with null in the database.
Fixed support for case insensitive comparisons of
textcolumns in PostgreSQL.
Made ActiveRecord consistently use
Serialize JSON attribute value
NULL, not JSON
Trung Duc Tran
update_attributewhen the value of the attribute to be updated is unchanged.
Always store errors details information with symbols.
When the association is autosaved we were storing the details with string keys. This was creating inconsistency with other details that are added using the
Errors#addmethod. It was also inconsistent with the
To fix this inconsistency we are always storing with symbols. This will cause a small breaking change because in those cases the details could be accessed as strings keys but now it can not.
Rafael Mendonça França, Marcus Vieira
touchon a model using optimistic locking will now leave the model in a non-dirty state with no attribute changes.
Using a mysql2 connection after it fails to reconnect will now have an error message saying the connection is closed rather than an undefined method error message.
PostgreSQL array columns will now respect the encoding of strings contained in the array.
Inverse association instances will now be set before
after_initializecallbacks are run.
Remove unnecessarily association load when a
belongs_toassociation has already been loaded then the foreign key is changed directly and the record saved.
Remove standardized column types/arguments spaces in schema dump.
Avoid loading records from database when they are already loaded using the
pluckmethod on a collection.
Remove text default treated as an empty string in non-strict mode for consistency with other types.
Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. If strict mode is not in effect, MySQL inserts adjusted values for invalid or missing values and produces warnings.
def test_mysql_not_null_defaults_non_strict using_strict(false) do with_mysql_not_null_table do |klass| record = klass.new assert_nil record.non_null_integer assert_nil record.non_null_string assert_nil record.non_null_text assert_nil record.non_null_blob record.save! record.reload assert_equal 0, record.non_null_integer assert_equal "", record.non_null_string assert_equal "", record.non_null_text assert_equal "", record.non_null_blob end end end
Sqlite3 migrations to add a column to an existing table can now be successfully rolled back when the column was given and invalid column type.
Doing count on relations that contain LEFT OUTER JOIN Arel node no longer force a DISTINCT. This solves issues when using count after a left_joins.
Maxime Handfield Lapointe
RecordNotFound raised by association.find exposes
modelmethods to be consistent with RecordNotFound raised by Record.find.
Hashes can once again be passed to setters of
composed_of, if all of the mapping methods are methods implemented on
Fix the SELECT statement in
Virtual attributes will no longer raise when read on models loaded from the database
Support calling the method
Fixes multi-parameter attributes conversion with invalid params.
Add newline between each migration in
Keeps schema migration inserts as a single commit, but allows for easier git diffing.
Grey Baker, Norberto Lopes
error_on_ignored_order_or_limithas been deprecated in favor of the current
Batch processing methods support
Post.limit(10_000).find_each do |post| # ... end
It also works in
groupwith an attribute that has a custom type will properly cast the hash keys after calling a calculation method like
Fix the generated
#to_parammethod to use
omission: ''so that the resulting output is actually up to 20 characters, not effectively 17 to leave room for the default "...". Also call
#truncateand make the
separator: /-/to maximize the information included in the output.
Ensure concurrent invocations of the connection reaper cannot allocate the same connection to two threads.
Inspecting an object with an associated array of over 10 elements no longer truncates the array, preventing
inspectfrom looping infinitely in some cases.
Removed the unused methods
Ensure hashes can be assigned to attributes created using
Fix logging edge case where if an attribute was of the binary type and was provided as a Hash.
Handle JSON deserialization correctly if the column default from database adapter returns
ActiveRecord::TransactionSerializationErrorfor catching transaction serialization failures or deadlocks.
db:structure:loadsilent failure on SQL error.
The command line flag
-v ON_ERROR_STOP=1should be used when invoking
psqlto make sure errors are not suppressed.
psql -v ON_ERROR_STOP=1 -q -f awesome-file.sql my-app-db
Please check 5-0-stable for previous changes.