mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-09 22:56:48 -04:00
Fetch updates in reverse chronological order by default.
This commit is contained in:
1 parent
ed896dd7a5
commit
e6eb30fbbf
2 files changed
+6
-1
No files matched your search
@@ -1,4 +1,5 @@
|
||||
class Update < ActiveRecord::Base
|
||||
attr_accessible :body, :subject, :user_id
|
||||
belongs_to :user
|
||||
default_scope order("created_at desc")
|
||||
end
|
||||
@@ -1,5 +1,9 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Update do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
it "should be sorted in reverse order" do
|
||||
Update.create! :subject => "first entry", :body => "blah", :user_id => 1
|
||||
Update.create! :subject => "second entry", :body => "blah", :user_id => 1
|
||||
Update.first.subject.should == "second entry"
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user