Sha256: d8fb0cc13e19dc7e5707cd743e62ee5aaeca3ad975a382fdbc5b174c36bf0d9e

Contents?: true

Size: 409 Bytes

Versions: 2

Compression:

Stored size: 409 Bytes

Contents

module Socialization
  module LikeStore
    extend ActiveSupport::Concern

    included do
      belongs_to :liker,    :polymorphic => true
      belongs_to :likeable, :polymorphic => true

      validates_uniqueness_of :likeable_type, :scope => [:likeable_id, :liker_type, :liker_id], :message => 'You cannot like the same thing twice.'

      def self.human_attribute_name(*args); ''; end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
socialization-0.4.0 lib/socialization/like_store.rb
socialization-0.3.0 lib/socialization/like_store.rb