Module: Redis::Actions::Creating::ClassMethods

Defined in:
lib/redis/actions/creating.rb

Instance Method Summary collapse

Instance Method Details

#create(attributes = {}) ⇒ Object



19
20
21
22
23
# File 'lib/redis/actions/creating.rb', line 19

def create(attributes = {})
  record = new(attributes)
  record.save
  record
end

#create!(attributes = {}) ⇒ Object



25
26
27
28
29
# File 'lib/redis/actions/creating.rb', line 25

def create!(attributes = {})
  record = new(attributes)
  record.save!
  record
end