Sha256: fcdd5ce561dd0f3c007dc3e280734511abac67cbcea1f5ffddea641888b5bfb8

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

class Person < ActiveRecord::Base
  include Carnival::ModelHelper

  has_many :photos
  has_many :addresses
  has_many :phones, as: :phoneable

  accepts_nested_attributes_for :photos, :reject_if => lambda { |a| a[:image].blank? }, :allow_destroy => true
  accepts_nested_attributes_for :addresses, :reject_if => lambda { |a| a[:address].blank? }, :allow_destroy => true
  accepts_nested_attributes_for :phones, :reject_if => lambda { |a| a[:number].blank? }, :allow_destroy => true
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
carnival-0.1.3 test/carnival-sample-application/app/models/person.rb
carnival-0.1.2 test/carnival-sample-application/app/models/person.rb
carnival-0.1.1 test/carnival-sample-application/app/models/person.rb
carnival-0.1.0 test/carnival-sample-application/app/models/person.rb