Sha256: 8b27df0a7779cd661d6dfdb30df035d87ea5fe93dd13bf72b98c3d2e3e4dc1dc

Contents?: true

Size: 985 Bytes

Versions: 26

Compression:

Stored size: 985 Bytes

Contents

# == Schema Information
#
# Table name: personal_recommendations
#
#  id                          :integer(4)      not null, primary key
#  personal_recommendable_id   :integer(4)
#  personal_recommendable_type :string(255)
#  destination_id              :integer(4)
#  destination_type            :string(255)
#  relevance                   :float
#  created_at                  :datetime
#  visited_at                  :datetime
#

class PersonalRecommendation < ActiveRecord::Base
  
  belongs_to :personal_recommendable, :polymorphic => true
  belongs_to :destination, :polymorphic => true
  
  named_scope :limit, lambda { |num| { :limit => num } }
  named_scope :recent, lambda { { :conditions => ['created_at > ?', 1.week.ago] } }
  named_scope :newest, :order => "created_at DESC"
  named_scope :entries_only, :conditions => ["personal_recommendations.destination_type = 'Entry'"]
  named_scope :users, :conditions => ["personal_recommendations.destination_type = 'User'"]
end

Version data entries

26 entries across 26 versions & 1 rubygems

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