Module: Fooltip::ActiveRecord

Defined in:
lib/fooltip/active_record.rb

Instance Method Summary collapse

Instance Method Details

#has_fooltipsObject



4
5
6
7
8
# File 'lib/fooltip/active_record.rb', line 4

def has_fooltips
  has_many :fooltip_associations, as: :owner, class_name: "Fooltip::Association", dependent: :destroy
  has_many :fooltips, through: :fooltip_associations, source: :container, class_name: "Fooltip::Container"
  accepts_nested_attributes_for :fooltip_associations, reject_if: :all_blank, allow_destroy: true
end