Sha256: 950f5be6283eeaf1e87067a2be5e8eb9d05853baa56a30cba4a57ebf35503255

Contents?: true

Size: 600 Bytes

Versions: 26

Compression:

Stored size: 600 Bytes

Contents

module ActiveRecord
  module Acts #:nodoc:
    module MuckRecommendations # :nodoc:

      def self.included(base)
        base.extend(ClassMethods)
      end
  
      module ClassMethods

        # +has_muck_recommendations+ gives the class it is called on personalized recommendations
        def has_muck_recommendations
          has_many :personal_recommendations, :as => :personal_recommendable
        end

        def acts_as_muck_recommendation
          has_many :recommended_to, :as => :destination, :class_name => 'PersonalRecommendation'
        end
        
      end

    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
muck-services-0.1.47 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.46 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.42 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.39 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.38 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.37 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.36 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.35 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.34 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.33 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.32 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.31 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.30 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.29 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.28 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.27 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.26 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.25 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.23 lib/active_record/acts/muck_recommendations.rb
muck-services-0.1.22 lib/active_record/acts/muck_recommendations.rb