acts_as_sourceable 1.0.4 → 1.0.5
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.
data/acts_as_sourceable.gemspec
CHANGED
|
@@ -101,7 +101,7 @@ module ActsAsSourceable
|
|
|
101
101
|
existing_source_ids = sourceable_institutions.pluck('holding_institution_id')
|
|
102
102
|
|
|
103
103
|
# Delete those that have been removed
|
|
104
|
-
condition = holding_institution_ids.any? ? "holding_institution_id NOT IN (?)" : nil # Can't use "NOT IN (?)" for an empty array because the result is always false
|
|
104
|
+
condition = holding_institution_ids.any? ? ["holding_institution_id NOT IN (?)", existing_source_ids] : nil # Can't use "NOT IN (?)" for an empty array because the result is always false
|
|
105
105
|
SourceableInstitution.where(:sourceable_type => self.class.name, :sourceable_id => self.id).delete_all(condition)
|
|
106
106
|
|
|
107
107
|
# Add those that are not present
|