Hello community,
here is the log from the commit of package rubygem-activerecord-5_1 for
openSUSE:Factory checked in at 2018-07-18 22:48:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-activerecord-5_1 (Old)
and /work/SRC/openSUSE:Factory/.rubygem-activerecord-5_1.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-activerecord-5_1"
Wed Jul 18 22:48:20 2018 rev:5 rq:620983 version:5.1.6
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-activerecord-5_1/rubygem-activerecord-5_1.changes
2018-02-18 11:44:40.508623560 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-activerecord-5_1.new/rubygem-activerecord-5_1.changes
2018-07-18 22:48:23.068066114 +0200
@@ -1,0 +2,53 @@
+Fri Mar 30 04:31:05 UTC 2018 - [email protected]
+
+- updated to version 5.1.6
+ see installed CHANGELOG.md
+
+ ## Rails 5.1.6 (March 29, 2018) ##
+
+ * MySQL: Support mysql2 0.5.x.
+
+ *Aaron Stone*
+
+ * Apply time column precision on assignment.
+
+ PR #20317 changed the behavior of datetime columns so that when they
+ have a specified precision then on assignment the value is rounded to
+ that precision. This behavior is now applied to time columns as well.
+
+ Fixes #30301.
+
+ *Andrew White*
+
+ * Normalize time column values for SQLite database.
+
+ For legacy reasons, time columns in SQLite are stored as full datetimes
+ because until #24542 the quoting for time columns didn't remove the date
+ component. To ensure that values are consistent we now normalize the
+ date component to 2001-01-01 on reading and writing.
+
+ *Andrew White*
+
+ * Ensure that the date component is removed when quoting times.
+
+ PR #24542 altered the quoting for time columns so that the date component
+ was removed however it only removed it when it was 2001-01-01. Now the
+ date component is removed irrespective of what the date is.
+
+ *Andrew White*
+
+ * Fix that after commit callbacks on update does not triggered when
optimistic locking is enabled.
+
+ *Ryuta Kamizono*
+
+ * `ActiveRecord::Persistence#touch` does not work well when optimistic
locking enabled and
+ `locking_column`, without default value, is null in the database.
+
+ *bogdanvlviv*
+
+ * Fix destroying existing object does not work well when optimistic
locking enabled and
+ `locking column` is null in the database.
+
+ *bogdanvlviv*
+
+-------------------------------------------------------------------
Old:
----
activerecord-5.1.5.gem
New:
----
activerecord-5.1.6.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-activerecord-5_1.spec ++++++
--- /var/tmp/diff_new_pack.dZo9Mc/_old 2018-07-18 22:48:23.492064708 +0200
+++ /var/tmp/diff_new_pack.dZo9Mc/_new 2018-07-18 22:48:23.496064695 +0200
@@ -24,7 +24,7 @@
#
Name: rubygem-activerecord-5_1
-Version: 5.1.5
+Version: 5.1.6
Release: 0
%define mod_name activerecord
%define mod_full_name %{mod_name}-%{version}
++++++ activerecord-5.1.5.gem -> activerecord-5.1.6.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2018-02-14 20:54:31.000000000 +0100
+++ new/CHANGELOG.md 2018-03-29 20:27:10.000000000 +0200
@@ -1,5 +1,57 @@
+## Rails 5.1.6 (March 29, 2018) ##
+
+* MySQL: Support mysql2 0.5.x.
+
+ *Aaron Stone*
+
+* Apply time column precision on assignment.
+
+ PR #20317 changed the behavior of datetime columns so that when they
+ have a specified precision then on assignment the value is rounded to
+ that precision. This behavior is now applied to time columns as well.
+
+ Fixes #30301.
+
+ *Andrew White*
+
+* Normalize time column values for SQLite database.
+
+ For legacy reasons, time columns in SQLite are stored as full datetimes
+ because until #24542 the quoting for time columns didn't remove the date
+ component. To ensure that values are consistent we now normalize the
+ date component to 2001-01-01 on reading and writing.
+
+ *Andrew White*
+
+* Ensure that the date component is removed when quoting times.
+
+ PR #24542 altered the quoting for time columns so that the date component
+ was removed however it only removed it when it was 2001-01-01. Now the
+ date component is removed irrespective of what the date is.
+
+ *Andrew White*
+
+* Fix that after commit callbacks on update does not triggered when
optimistic locking is enabled.
+
+ *Ryuta Kamizono*
+
+* `ActiveRecord::Persistence#touch` does not work well when optimistic
locking enabled and
+ `locking_column`, without default value, is null in the database.
+
+ *bogdanvlviv*
+
+* Fix destroying existing object does not work well when optimistic locking
enabled and
+ `locking column` is null in the database.
+
+ *bogdanvlviv*
+
+
## Rails 5.1.5 (February 14, 2018) ##
+* PostgreSQL: Allow pg-1.0 gem to be used with Active Record.
+
+ *Lars Kanis*
+
* Fix `count(:all)` with eager loading and having an order other than the
driving table.
Fixes #31783.
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/attribute_set/builder.rb
new/lib/active_record/attribute_set/builder.rb
--- old/lib/active_record/attribute_set/builder.rb 2018-02-14
20:54:31.000000000 +0100
+++ new/lib/active_record/attribute_set/builder.rb 2018-03-29
20:27:10.000000000 +0200
@@ -3,35 +3,30 @@
module ActiveRecord
class AttributeSet # :nodoc:
class Builder # :nodoc:
- attr_reader :types, :always_initialized, :default
+ attr_reader :types, :default_attributes
- def initialize(types, always_initialized = nil, &default)
+ def initialize(types, default_attributes = {})
@types = types
- @always_initialized = always_initialized
- @default = default
+ @default_attributes = default_attributes
end
def build_from_database(values = {}, additional_types = {})
- if always_initialized && !values.key?(always_initialized)
- values[always_initialized] = nil
- end
-
- attributes = LazyAttributeHash.new(types, values, additional_types,
&default)
+ attributes = LazyAttributeHash.new(types, values, additional_types,
default_attributes)
AttributeSet.new(attributes)
end
end
end
class LazyAttributeHash # :nodoc:
- delegate :transform_values, :each_key, :each_value, :fetch, to:
:materialize
+ delegate :transform_values, :each_key, :each_value, :fetch, :except, to:
:materialize
- def initialize(types, values, additional_types, &default)
+ def initialize(types, values, additional_types, default_attributes,
delegate_hash = {})
@types = types
@values = values
@additional_types = additional_types
@materialized = false
- @delegate_hash = {}
- @default = default || proc {}
+ @delegate_hash = delegate_hash
+ @default_attributes = default_attributes
end
def key?(key)
@@ -79,22 +74,24 @@
end
def marshal_dump
- materialize
+ [@types, @values, @additional_types, @default_attributes, @delegate_hash]
end
- def marshal_load(delegate_hash)
- @delegate_hash = delegate_hash
- @types = {}
- @values = {}
- @additional_types = {}
- @materialized = true
+ def marshal_load(values)
+ if values.is_a?(Hash)
+ empty_hash = {}.freeze
+ initialize(empty_hash, empty_hash, empty_hash, empty_hash, values)
+ @materialized = true
+ else
+ initialize(*values)
+ end
end
# TODO Change this to private once we've dropped Ruby 2.2 support.
# Workaround for Ruby 2.2 "private attribute?" warning.
protected
- attr_reader :types, :values, :additional_types, :delegate_hash, :default
+ attr_reader :types, :values, :additional_types, :delegate_hash,
:default_attributes
def materialize
unless @materialized
@@ -117,7 +114,12 @@
if value_present
delegate_hash[name] = Attribute.from_database(name, value, type)
elsif types.key?(name)
- delegate_hash[name] = default.call(name) ||
Attribute.uninitialized(name, type)
+ attr = default_attributes[name]
+ if attr
+ delegate_hash[name] = attr.dup
+ else
+ delegate_hash[name] = Attribute.uninitialized(name, type)
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/attribute_set.rb
new/lib/active_record/attribute_set.rb
--- old/lib/active_record/attribute_set.rb 2018-02-14 20:54:31.000000000
+0100
+++ new/lib/active_record/attribute_set.rb 2018-03-29 20:27:10.000000000
+0200
@@ -3,7 +3,7 @@
module ActiveRecord
class AttributeSet # :nodoc:
- delegate :each_value, :fetch, to: :attributes
+ delegate :each_value, :fetch, :except, to: :attributes
def initialize(attributes)
@attributes = attributes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/attributes.rb
new/lib/active_record/attributes.rb
--- old/lib/active_record/attributes.rb 2018-02-14 20:54:31.000000000 +0100
+++ new/lib/active_record/attributes.rb 2018-03-29 20:27:10.000000000 +0200
@@ -56,7 +56,7 @@
# store_listing = StoreListing.new(price_in_cents: '10.1')
#
# # before
- # store_listing.price_in_cents # => BigDecimal.new(10.1)
+ # store_listing.price_in_cents # => BigDecimal(10.1)
#
# class StoreListing < ActiveRecord::Base
# attribute :price_in_cents, :integer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/active_record/connection_adapters/abstract/quoting.rb
new/lib/active_record/connection_adapters/abstract/quoting.rb
--- old/lib/active_record/connection_adapters/abstract/quoting.rb
2018-02-14 20:54:31.000000000 +0100
+++ new/lib/active_record/connection_adapters/abstract/quoting.rb
2018-03-29 20:27:10.000000000 +0200
@@ -152,7 +152,7 @@
end
def quoted_time(value) # :nodoc:
- quoted_date(value).sub(/\A2000-01-01 /, "")
+ quoted_date(value).sub(/\A\d\d\d\d-\d\d-\d\d /, "")
end
def quoted_binary(value) # :nodoc:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/active_record/connection_adapters/mysql2_adapter.rb
new/lib/active_record/connection_adapters/mysql2_adapter.rb
--- old/lib/active_record/connection_adapters/mysql2_adapter.rb 2018-02-14
20:54:31.000000000 +0100
+++ new/lib/active_record/connection_adapters/mysql2_adapter.rb 2018-03-29
20:27:10.000000000 +0200
@@ -1,7 +1,7 @@
require "active_record/connection_adapters/abstract_mysql_adapter"
require "active_record/connection_adapters/mysql/database_statements"
-gem "mysql2", ">= 0.3.18", "< 0.5"
+gem "mysql2", ">= 0.3.18", "< 0.6.0"
require "mysql2"
raise "mysql2 0.4.3 is not supported. Please upgrade to 0.4.4+" if
Mysql2::VERSION == "0.4.3"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/active_record/connection_adapters/postgresql/oid/decimal.rb
new/lib/active_record/connection_adapters/postgresql/oid/decimal.rb
--- old/lib/active_record/connection_adapters/postgresql/oid/decimal.rb
2018-02-14 20:54:31.000000000 +0100
+++ new/lib/active_record/connection_adapters/postgresql/oid/decimal.rb
2018-03-29 20:27:10.000000000 +0200
@@ -4,7 +4,7 @@
module OID # :nodoc:
class Decimal < Type::Decimal # :nodoc:
def infinity(options = {})
- BigDecimal.new("Infinity") * (options[:negative] ? -1 : 1)
+ BigDecimal("Infinity") * (options[:negative] ? -1 : 1)
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/active_record/connection_adapters/postgresql/schema_statements.rb
new/lib/active_record/connection_adapters/postgresql/schema_statements.rb
--- old/lib/active_record/connection_adapters/postgresql/schema_statements.rb
2018-02-14 20:54:31.000000000 +0100
+++ new/lib/active_record/connection_adapters/postgresql/schema_statements.rb
2018-03-29 20:27:10.000000000 +0200
@@ -122,7 +122,7 @@
comment = row[5]
opclass = row[6]
- using, expressions, where = inddef.scan(/ USING (\w+?)
\((.+?)\)(?: WHERE (.+))?\z/).flatten
+ using, expressions, where = inddef.scan(/ USING (\w+?)
\((.+?)\)(?: WHERE (.+))?\z/m).flatten
if indkey.include?(0) || opclass > 0
columns = expressions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/active_record/connection_adapters/sqlite3/quoting.rb
new/lib/active_record/connection_adapters/sqlite3/quoting.rb
--- old/lib/active_record/connection_adapters/sqlite3/quoting.rb
2018-02-14 20:54:32.000000000 +0100
+++ new/lib/active_record/connection_adapters/sqlite3/quoting.rb
2018-03-29 20:27:10.000000000 +0200
@@ -15,7 +15,7 @@
end
def quoted_time(value)
- quoted_date(value)
+ quoted_date(value).sub(/\A\d\d\d\d-\d\d-\d\d /, "2000-01-01 ")
end
def quoted_binary(value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/gem_version.rb
new/lib/active_record/gem_version.rb
--- old/lib/active_record/gem_version.rb 2018-02-14 20:54:32.000000000
+0100
+++ new/lib/active_record/gem_version.rb 2018-03-29 20:27:10.000000000
+0200
@@ -7,7 +7,7 @@
module VERSION
MAJOR = 5
MINOR = 1
- TINY = 5
+ TINY = 6
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/locking/optimistic.rb
new/lib/active_record/locking/optimistic.rb
--- old/lib/active_record/locking/optimistic.rb 2018-02-14 20:54:32.000000000
+0100
+++ new/lib/active_record/locking/optimistic.rb 2018-03-29 20:27:10.000000000
+0200
@@ -60,13 +60,6 @@
end
private
-
- def increment_lock
- lock_col = self.class.locking_column
- previous_lock_value = send(lock_col).to_i
- send(lock_col + "=", previous_lock_value + 1)
- end
-
def _create_record(attribute_names = self.attribute_names, *)
if locking_enabled?
# We always want to persist the locking version, even if we don't
detect
@@ -76,39 +69,37 @@
super
end
- def _update_record(attribute_names = self.attribute_names)
+ def _touch_row(attribute_names, time)
+ super
+ ensure
+ clear_attribute_change(self.class.locking_column) if locking_enabled?
+ end
+
+ def _update_row(attribute_names, attempted_action = "update")
return super unless locking_enabled?
- return 0 if attribute_names.empty?
begin
- lock_col = self.class.locking_column
-
- previous_lock_value = read_attribute_before_type_cast(lock_col)
-
- increment_lock
-
- attribute_names.push(lock_col)
+ locking_column = self.class.locking_column
+ previous_lock_value =
read_attribute_before_type_cast(locking_column)
+ attribute_names << locking_column
- relation = self.class.unscoped
+ self[locking_column] += 1
- affected_rows = relation.where(
- self.class.primary_key => id,
- lock_col => previous_lock_value
- ).update_all(
- attributes_for_update(attribute_names).map do |name|
- [name, _read_attribute(name)]
- end.to_h
+ affected_rows = self.class.unscoped._update_record(
+ arel_attributes_with_values(attribute_names),
+ self.class.primary_key => id_in_database,
+ locking_column => previous_lock_value
)
- unless affected_rows == 1
- raise ActiveRecord::StaleObjectError.new(self, "update")
+ if affected_rows != 1
+ raise ActiveRecord::StaleObjectError.new(self, attempted_action)
end
affected_rows
# If something went wrong, revert the locking_column value.
rescue Exception
- send(lock_col + "=", previous_lock_value.to_i)
+ self[locking_column] = previous_lock_value.to_i
raise
end
end
@@ -128,7 +119,7 @@
if locking_enabled?
locking_column = self.class.locking_column
- relation = relation.where(locking_column =>
_read_attribute(locking_column))
+ relation = relation.where(locking_column =>
read_attribute_before_type_cast(locking_column))
end
relation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/model_schema.rb
new/lib/active_record/model_schema.rb
--- old/lib/active_record/model_schema.rb 2018-02-14 20:54:32.000000000
+0100
+++ new/lib/active_record/model_schema.rb 2018-03-29 20:27:10.000000000
+0200
@@ -332,11 +332,11 @@
end
def attributes_builder # :nodoc:
- @attributes_builder ||= AttributeSet::Builder.new(attribute_types,
primary_key) do |name|
- unless columns_hash.key?(name)
- _default_attributes[name].dup
- end
+ unless defined?(@attributes_builder) && @attributes_builder
+ defaults = _default_attributes.except(*(column_names -
[primary_key]))
+ @attributes_builder = AttributeSet::Builder.new(attribute_types,
defaults)
end
+ @attributes_builder
end
def columns_hash # :nodoc:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/persistence.rb
new/lib/active_record/persistence.rb
--- old/lib/active_record/persistence.rb 2018-02-14 20:54:32.000000000
+0100
+++ new/lib/active_record/persistence.rb 2018-03-29 20:27:10.000000000
+0200
@@ -505,36 +505,12 @@
MSG
end
- time ||= current_time_from_proper_timezone
- attributes = timestamp_attributes_for_update_in_model
- attributes.concat(names)
-
- unless attributes.empty?
- changes = {}
-
- attributes.each do |column|
- column = column.to_s
- changes[column] = write_attribute(column, time)
- end
-
- primary_key = self.class.primary_key
- scope = self.class.unscoped.where(primary_key =>
_read_attribute(primary_key))
-
- if locking_enabled?
- locking_column = self.class.locking_column
- scope = scope.where(locking_column =>
_read_attribute(locking_column))
- changes[locking_column] = increment_lock
- end
-
- clear_attribute_changes(changes.keys)
- result = scope.update_all(changes) == 1
-
- if !result && locking_enabled?
- raise ActiveRecord::StaleObjectError.new(self, "touch")
- end
+ attribute_names = timestamp_attributes_for_update_in_model
+ attribute_names.concat(names)
- @_trigger_update_callback = result
- result
+ unless attribute_names.empty?
+ affected_rows = _touch_row(attribute_names, time)
+ @_trigger_update_callback = affected_rows == 1
else
true
end
@@ -554,6 +530,24 @@
self.class.unscoped.where(self.class.primary_key => id)
end
+ def _touch_row(attribute_names, time)
+ time ||= current_time_from_proper_timezone
+
+ attribute_names.each do |attr_name|
+ write_attribute(attr_name, time)
+ clear_attribute_change(attr_name)
+ end
+
+ _update_row(attribute_names, "touch")
+ end
+
+ def _update_row(attribute_names, attempted_action = "update")
+ self.class.unscoped._update_record(
+ arel_attributes_with_values(attribute_names),
+ self.class.primary_key => id_in_database
+ )
+ end
+
def create_or_update(*args, &block)
_raise_readonly_record_error if readonly?
result = new_record? ? _create_record(&block) : _update_record(*args,
&block)
@@ -563,23 +557,26 @@
# Updates the associated record with values matching those of the instance
attributes.
# Returns the number of affected rows.
def _update_record(attribute_names = self.attribute_names)
- attributes_values =
arel_attributes_with_values_for_update(attribute_names)
- if attributes_values.empty?
- rows_affected = 0
+ attribute_names &= self.class.column_names
+ attribute_names = attributes_for_update(attribute_names)
+
+ if attribute_names.empty?
+ affected_rows = 0
@_trigger_update_callback = true
else
- rows_affected = self.class.unscoped._update_record attributes_values,
id, id_in_database
- @_trigger_update_callback = rows_affected > 0
+ affected_rows = _update_row(attribute_names)
+ @_trigger_update_callback = affected_rows == 1
end
yield(self) if block_given?
- rows_affected
+ affected_rows
end
# Creates a record with values matching those of the instance attributes
# and returns its id.
def _create_record(attribute_names = self.attribute_names)
+ attribute_names &= self.class.column_names
attributes_values =
arel_attributes_with_values_for_create(attribute_names)
new_id = self.class.unscoped.insert attributes_values
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/query_cache.rb
new/lib/active_record/query_cache.rb
--- old/lib/active_record/query_cache.rb 2018-02-14 20:54:32.000000000
+0100
+++ new/lib/active_record/query_cache.rb 2018-03-29 20:27:10.000000000
+0200
@@ -5,20 +5,20 @@
# Enable the query cache within the block if Active Record is configured.
# If it's not, it will execute the given block.
def cache(&block)
- if configurations.empty?
- yield
- else
+ if connected? || !configurations.empty?
connection.cache(&block)
+ else
+ yield
end
end
# Disable the query cache within the block if Active Record is
configured.
# If it's not, it will execute the given block.
def uncached(&block)
- if configurations.empty?
- yield
- else
+ if connected? || !configurations.empty?
connection.uncached(&block)
+ else
+ yield
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/relation/calculations.rb
new/lib/active_record/relation/calculations.rb
--- old/lib/active_record/relation/calculations.rb 2018-02-14
20:54:32.000000000 +0100
+++ new/lib/active_record/relation/calculations.rb 2018-03-29
20:27:10.000000000 +0200
@@ -112,7 +112,7 @@
if has_include?(column_name)
relation = construct_relation_for_association_calculations
- if operation.to_s.downcase == "count" && !distinct_value
+ if operation.to_s.downcase == "count"
relation.distinct!
# PostgreSQL: ORDER BY expressions must appear in SELECT list when
using DISTINCT
if (column_name == :all || column_name.nil?) && select_values.empty?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/relation.rb
new/lib/active_record/relation.rb
--- old/lib/active_record/relation.rb 2018-02-14 20:54:32.000000000 +0100
+++ new/lib/active_record/relation.rb 2018-03-29 20:27:10.000000000 +0200
@@ -67,7 +67,7 @@
binds)
end
- def _update_record(values, id, id_was) # :nodoc:
+ def _update_record(values, constraints) # :nodoc:
substitutes, binds = substitute_values values
scope = @klass.unscoped
@@ -76,7 +76,7 @@
scope.unscope!(where: @klass.inheritance_column)
end
- relation = scope.where(@klass.primary_key => (id_was || id))
+ relation = scope.where(constraints)
bvs = binds + relation.bound_attributes
um = relation
.arel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_record/validations/uniqueness.rb
new/lib/active_record/validations/uniqueness.rb
--- old/lib/active_record/validations/uniqueness.rb 2018-02-14
20:54:32.000000000 +0100
+++ new/lib/active_record/validations/uniqueness.rb 2018-03-29
20:27:10.000000000 +0200
@@ -17,7 +17,7 @@
relation = build_relation(finder_class, attribute, value)
if record.persisted?
if finder_class.primary_key
- relation = relation.where.not(finder_class.primary_key =>
record.id_in_database || record.id)
+ relation = relation.where.not(finder_class.primary_key =>
record.id_in_database)
else
raise UnknownPrimaryKey.new(finder_class, "Can not validate
uniqueness for persisted record without primary key.")
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2018-02-14 20:54:31.000000000 +0100
+++ new/metadata 2018-03-29 20:27:10.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: activerecord
version: !ruby/object:Gem::Version
- version: 5.1.5
+ version: 5.1.6
platform: ruby
authors:
- David Heinemeier Hansson
autorequire:
bindir: bin
cert_chain: []
-date: 2018-02-14 00:00:00.000000000 Z
+date: 2018-03-29 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: activesupport
@@ -16,28 +16,28 @@
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.1.5
+ version: 5.1.6
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.1.5
+ version: 5.1.6
- !ruby/object:Gem::Dependency
name: activemodel
requirement: !ruby/object:Gem::Requirement
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.1.5
+ version: 5.1.6
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.1.5
+ version: 5.1.6
- !ruby/object:Gem::Dependency
name: arel
requirement: !ruby/object:Gem::Requirement
@@ -320,8 +320,8 @@
licenses:
- MIT
metadata:
- source_code_uri: https://github.com/rails/rails/tree/v5.1.5/activerecord
- changelog_uri:
https://github.com/rails/rails/blob/v5.1.5/activerecord/CHANGELOG.md
+ source_code_uri: https://github.com/rails/rails/tree/v5.1.6/activerecord
+ changelog_uri:
https://github.com/rails/rails/blob/v5.1.6/activerecord/CHANGELOG.md
post_install_message:
rdoc_options:
- "--main"
@@ -340,7 +340,7 @@
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.7.3
+rubygems_version: 2.6.14
signing_key:
specification_version: 4
summary: Object-relational mapper framework (part of Rails).