fix two order clauses which create unambiguous sql queries

pull/1186/head
Martin Linkhorst 12 years ago
parent 7e11d1b148
commit ef6680636e
  1. 3
      app/models/news.rb
  2. 3
      app/models/project.rb

@ -56,8 +56,9 @@ class News < ActiveRecord::Base
where(conditions).limit(limit).newest_first.includes(:author, :project)
end
# table_name shouldn't be needed :(
def self.newest_first
order 'created_on DESC'
order "#{table_name}.created_on DESC"
end
def new_comment(attributes = {})

@ -139,8 +139,9 @@ class Project < ActiveRecord::Base
where(conditions).limit(limit).newest_first
end
# table_name shouldn't be needed :(
def self.newest_first
order 'created_on DESC'
order "#{table_name}.created_on DESC"
end
# Returns a SQL :conditions string used to find all active projects for the specified user.

Loading…
Cancel
Save