Sha256: e526626c20d7b5876bfeb3153c1dbf1ff310f8dae7d021d600493b0c05d3a7e2

Contents?: true

Size: 414 Bytes

Versions: 37

Compression:

Stored size: 414 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", :inverse_of => :item
        accepts_nested_attributes_for :piggybak_sellable, :allow_destroy => true
      end      
    end
  end
end

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

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
piggybak-0.7.7 lib/acts_as_sellable.rb
piggybak-0.7.6 lib/acts_as_sellable.rb
piggybak-0.7.5 lib/acts_as_sellable.rb
piggybak-0.6.34 lib/acts_as_sellable.rb
piggybak-0.7.4 lib/acts_as_sellable.rb
piggybak-0.7.3 lib/acts_as_sellable.rb
piggybak-0.7.2 lib/acts_as_sellable.rb
piggybak-0.7.1 lib/acts_as_sellable.rb
piggybak-0.7.0 lib/acts_as_sellable.rb
piggybak-0.6.33 lib/acts_as_sellable.rb
piggybak-0.6.32 lib/acts_as_sellable.rb
piggybak-0.6.31 lib/acts_as_sellable.rb
piggybak-0.6.30 lib/acts_as_sellable.rb
piggybak-0.6.29 lib/acts_as_sellable.rb
piggybak-0.6.28 lib/acts_as_sellable.rb
piggybak-0.6.27 lib/acts_as_sellable.rb
piggybak-0.6.26 lib/acts_as_sellable.rb
piggybak-0.6.25 lib/acts_as_sellable.rb
piggybak-0.6.24 lib/acts_as_sellable.rb
piggybak-0.6.23 lib/acts_as_sellable.rb