has_many :roles, :class_name => "UserRole"
+ has_many :issues, :class_name => "Issue", :foreign_key => :reported_user_id
+ has_many :issue_comments
+
+ has_many :reports
+
scope :visible, -> { where(:status => %w[pending active confirmed]) }
scope :active, -> { where(:status => %w[active confirmed]) }
scope :identifiable, -> { where(:data_public => true) }
.where("id != ?", id)
.where(sql_for_area)
.where("#{sql_for_distance} <= ?", radius)
- .order(sql_for_distance)
+ .order(Arel.sql(sql_for_distance))
.limit(num)
else
nearby = []