Module: BazaModels::Model::Manipulation::ClassMethods

Defined in:
lib/baza_models/model/manipulation.rb

Instance Method Summary collapse

Instance Method Details

#create(data = {}) ⇒ Object



111
112
113
114
115
# File 'lib/baza_models/model/manipulation.rb', line 111

def create(data = {})
  model = new(data)
  model.save
  model
end

#create!(data = {}) ⇒ Object



117
118
119
120
121
# File 'lib/baza_models/model/manipulation.rb', line 117

def create!(data = {})
  model = new(data)
  model.save!
  model
end