instance method
create_or_update
Ruby on Rails 7.1.6
Since v3.0.20 PrivateSignature
create_or_update(**, &block)
No documentation comment.
Parameters
-
kwargskeyrest -
blockblock
Source
# File activerecord/lib/active_record/persistence.rb, line 1218
def create_or_update(**, &block)
_raise_readonly_record_error if readonly?
return false if destroyed?
result = new_record? ? _create_record(&block) : _update_record(&block)
result != false
end
Defined in activerecord/lib/active_record/persistence.rb line 1218
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence