Method: EmbedsMany::Child#save

Defined in:
lib/embeds_many/child.rb

#saveObject



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/embeds_many/child.rb', line 48

def save
  return false unless self.valid?

  @operation_pending = true

  if new_record?
    save_new_record!
  else
    save_existing_record!
  end
ensure
  @operation_pending = false
end