lib/ajaxful_rating.rb
# Finds rateable objects by Rate's attribute.
Finds rateable objects by Rate's attribute.
Finds rateable objects by Rate ' s attribute .
def find_statement(attr_name, attr_value)
        rateable = self.base_class.name
        sql = sanitize_sql(["SELECT DISTINCT r2.* FROM rates r1 INNER JOIN " +
              "#{rateable.constantize.table_name} r2 ON r1.rateable_id = r2.id " +
              "WHERE (r1.[rateable_type] = ? AND r1.[#{attr_name}] = ?)",
            rateable, attr_value])
        find_by_sql(sql)
      end
def find_statement ( attr_name , attr_value ) rateable = self . base_class . name sql = sanitize_sql ( [ "SELECT DISTINCT r2.* FROM rates r1 INNER JOIN " + "#{rateable.constantize.table_name} r2 ON r1.rateable_id = r2.id " + "WHERE (r1.[rateable_type] = ? AND r1.[#{attr_name}] = ?)" , rateable , attr_value ] ) find_by_sql ( sql ) end
Finds rateable objects by Rate's attribute.
Finds rateable objects by Rate ' s attribute .
attr_name
<not_specific>
attr_value
<not_specific>