Sha256: fa65986227ea7c0c22bafdcd95b278a34b680e822bbd507a3ad3b69e9a6dea53

Contents?: true

Size: 381 Bytes

Versions: 42

Compression:

Stored size: 381 Bytes

Contents

module Piggybak
  module ActsAsVariant
    extend ActiveSupport::Concern

    module ClassMethods
      def acts_as_variant
        has_one :piggybak_variant, :as => "item", :class_name => "::Piggybak::Variant"

        accepts_nested_attributes_for :piggybak_variant, :allow_destroy => true
      end
    end
  end
end

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

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
piggybak-0.5.5 lib/acts_as_variant.rb
piggybak-0.5.4 lib/acts_as_variant.rb
piggybak-0.5.3 lib/acts_as_variant.rb
piggybak-0.5.2 lib/acts_as_variant.rb
piggybak-0.5.1 lib/acts_as_variant.rb
piggybak-0.5.0 lib/acts_as_variant.rb
piggybak-0.4.39 lib/acts_as_variant.rb
piggybak-0.4.38 lib/acts_as_variant.rb
piggybak-0.4.37 lib/acts_as_variant.rb
piggybak-0.4.36 lib/acts_as_variant.rb
piggybak-0.4.35 lib/acts_as_variant.rb
piggybak-0.4.34 lib/acts_as_variant.rb
piggybak-0.4.33 lib/acts_as_variant.rb
piggybak-0.4.32 lib/acts_as_variant.rb
piggybak-0.4.31 lib/acts_as_variant.rb
piggybak-0.4.30 lib/acts_as_variant.rb
piggybak-0.4.29 lib/acts_as_variant.rb
piggybak-0.4.28 lib/acts_as_variant.rb
piggybak-0.4.27 lib/acts_as_variant.rb
piggybak-0.4.26 lib/acts_as_variant.rb