Module: ActiveShotgun::Model::Write::ClassMethods

Defined in:
lib/active_shotgun/model/write.rb

Instance Method Summary collapse

Instance Method Details

#create(create_attributes) ⇒ Object



57
58
59
60
61
62
# File 'lib/active_shotgun/model/write.rb', line 57

def create(create_attributes)
  new_entity = new
  new_entity.mass_assign(create_attributes)
  new_entity.save
  new_entity
end

#create!(create_attributes) ⇒ Object



64
65
66
67
68
69
# File 'lib/active_shotgun/model/write.rb', line 64

def create!(create_attributes)
  new_entity = new
  new_entity.mass_assign(create_attributes)
  new_entity.save!
  new_entity
end