Sha256: 6f361958f97e0494d7dc5d94dbeb33e212814a9b639dd32324da30f541aac720

Contents?: true

Size: 427 Bytes

Versions: 2

Compression:

Stored size: 427 Bytes

Contents

module Socialization
  module FollowStore
    extend ActiveSupport::Concern

    included do
      belongs_to :follower,   :polymorphic => true
      belongs_to :followable, :polymorphic => true

      validates_uniqueness_of :followable_type, :scope => [:followable_id, :follower_type, :follower_id], :message => 'You cannot follow 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/follow_store.rb
socialization-0.3.0 lib/socialization/follow_store.rb