method
upsert
rails latest stable - Class:
ActiveRecord::Persistence::ClassMethods
upsert(attributes, **kwargs)public
Updates or inserts (upserts) a single record into the database in a single SQL INSERT statement. It does not instantiate any models nor does it trigger Active Record callbacks or validations. Though passed values go through Active Record’s type casting and serialization.
See #upsert_all for documentation.