Skip to content

Commit

Permalink
Remove default_scope, retain previous behavior of published
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Oct 31, 2013
1 parent a154b63 commit 55fc5a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/models/tweet.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
class Tweet < ActiveRecord::Base
default_scope { order("published_at desc") }

mount_uploader :image, ImageUploader

def self.published
where(published: true).where("published_at is not null")
where(published: true).where("published_at is not null").recent_first
end

def self.recent_first
order("published_at desc")
end

end

0 comments on commit 55fc5a3

Please sign in to comment.