Class: Rating

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/generators/rateme/templates/model.rb

Class Method Summary collapse

Class Method Details

.find_similar(rating) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/rateme/templates/model.rb', line 10

def self.find_similar(rating)
  Rating.find(
    :first, 
    :conditions => {
      :ip_address => rating.ip_address,
      :rateable_id => rating.rateable_id,
      :rateable_type => rating.rateable_type 
    }
  )
end