Sha256: a7c5ffe8a564c2cd6e30138e0df34440450935990696a4b4ffdf839aff4be66c

Contents?: true

Size: 415 Bytes

Versions: 15

Compression:

Stored size: 415 Bytes

Contents

module Impressionist
  module IsImpressionable
    extend ActiveSupport::Concern

    module ClassMethods
      def is_impressionable(options={})
        define_association
        @impressionist_cache_options = options

        true
      end

      private

      def define_association
        has_many(:impressions,
        :as => :impressionable,
        :dependent => :destroy)
      end
    end
  
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
impressionist-1.5.2 lib/impressionist/is_impressionable.rb
impressionist2-1.5.5 lib/impressionist/is_impressionable.rb
impressionist2-1.5.4 lib/impressionist/is_impressionable.rb
impressionist2-1.5.3 lib/impressionist/is_impressionable.rb
impressionist2-1.5.1 lib/impressionist/is_impressionable.rb
impressionist-1.5.1 lib/impressionist/is_impressionable.rb
impressionist-1.4.13 lib/impressionist/is_impressionable.rb
impressionist-1.4.12 lib/impressionist/is_impressionable.rb
impressionist-1.4.11 lib/impressionist/is_impressionable.rb
impressionist-1.4.10 lib/impressionist/is_impressionable.rb
impressionist-1.4.9 lib/impressionist/is_impressionable.rb
impressionist-1.4.8 lib/impressionist/is_impressionable.rb
impressionist-1.4.7 lib/impressionist/is_impressionable.rb
impressionist-1.4.6 lib/impressionist/is_impressionable.rb
impressionist-1.4.5 lib/impressionist/is_impressionable.rb