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

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

Instance Method Summary collapse

Instance Method Details

#create(data = {}) ⇒ Object



122
123
124
125
126
# File 'lib/baza_models/model/manipulation.rb', line 122

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

#create!(data = {}) ⇒ Object



128
129
130
131
132
# File 'lib/baza_models/model/manipulation.rb', line 128

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