tyler-composite_primary_keys 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,9 +80,8 @@ module ActiveRecord::Associations::ClassMethods
80
80
  association = join.instantiate(row)
81
81
  collection.target.push(association) unless collection.target.include?(association)
82
82
  when :has_one, :belongs_to
83
- return if record.id.to_s != join.parent.record_id(row).to_s or
84
- [*join.aliased_primary_key].any? { |key| row[key].nil? }
85
- association = join.instantiate(row)
83
+ return if record.id.to_s != join.parent.record_id(row).to_s
84
+ association = join.instantiate(row) unless [*join.aliased_primary_key].any? { |key| row[key].nil? }
86
85
  record.send("set_#{join.reflection.name}_target", association)
87
86
  else
88
87
  raise ConfigurationError, "unknown macro: #{join.reflection.macro}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tyler-composite_primary_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr Nic Williams