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