instance method
update_multiple_ids?
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
update_multiple_ids?(id)
update/update! accept either a single id or an array of ids. For a composite primary key a single id is itself an array, so an array of ids is an array of arrays, mirroring how #destroy tells the two apart.
Parameters
-
idreq
Source
# File activerecord/lib/active_record/relation.rb, line 1398
def update_multiple_ids?(id)
if model.composite_primary_key?
id.is_a?(Array) && (id.empty? || id.first.is_a?(Array))
else
id.is_a?(Array)
end
end
Defined in activerecord/lib/active_record/relation.rb line 1398
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation