Sha256: e5be2b4c8cffbda96746b9f7a8ab8e17a43e38d595a1142d9889ba4b48b97acd

Contents?: true

Size: 421 Bytes

Versions: 5

Compression:

Stored size: 421 Bytes

Contents

module Piggybak
  module ActsAsSellable
    extend ActiveSupport::Concern

    module ClassMethods
      
      def acts_as_sellable
        
        has_one :piggybak_sellable, :as => "item", :class_name => "::Piggybak::Sellable"
        
        accepts_nested_attributes_for :piggybak_sellable, :allow_destroy => true

      end      

    end
  end
end

::ActiveRecord::Base.send :include, Piggybak::ActsAsSellable


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
piggybak-0.6.4 lib/acts_as_sellable.rb
piggybak-0.6.3 lib/acts_as_sellable.rb
piggybak-0.6.2 lib/acts_as_sellable.rb
piggybak-0.6.1 lib/acts_as_sellable.rb
piggybak-0.6.0 lib/acts_as_sellable.rb