crnixon (owner)

Revisions

  • f684b0 crnixon Wed Sep 23 07:57:15 -0700 2009
  • d9514c crnixon Wed Sep 23 07:55:55 -0700 2009
gist: 192052 Download_button fork
public
Public Clone URL: git://gist.github.com/192052.git
Embed All Files: show embed
irb_output #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Textbook < Book; end
t = Textbook.new(:title => 'American History X')
=> #<Textbook created_at: , title: American History X, author: , updated_at: , _id: , user_id: , copyright: >
>> Book.all
=> [#<Book created_at: Sun Aug 30 20:23:29 UTC 2009, author: , title: Test, updated_at: Tue Sep 01 03:14:37 UTC 2009, _id: 4a9adfc1477a512507000002, user_id: c3e77bb24a980219000000ae, copyright: >, #<Book created_at: Sat Sep 19 18:10:20 UTC 2009, author: Herman Melville Jr, title: Moby Dick II, updated_at: Sat Sep 19 18:12:01 UTC 2009, _id: 4ab51e8c477a51b747000003, user_id: c3e77bb24a980219000000ae, copyright: >, #<Book created_at: Wed Sep 23 14:48:57 UTC 2009, author: , title: American History X, updated_at: Wed Sep 23 14:48:57 UTC 2009, _id: 4aba3559477a5192ea000002, user_id: , copyright: >, #<Book created_at: Wed Sep 23 14:53:12 UTC 2009, author: , title: American History X, updated_at: Wed Sep 23 14:53:12 UTC 2009, _id: 4aba3658477a51933f000002, user_id: , copyright: >]
 
>> Textbook.collection(:textbooks)
=> #<Mongo::Collection:0x102c037c8 @name="textbooks", @db=#<Mongo::DB:0x102d1e798 @name="wordbadger", @strict=nil, @pk_factory=nil, @socket=#<TCPSocket:0x102d1ddc0>, slave_oknil, port27017, semaphore#<Object:0x102d1e658 @mu_locked=false, @mu_waiting=[]>, nodes[["localhost", 27017]], auto_reconnectnil, host"localhost", hintnil
>> t2 = Textbook.new(:title => "Lies My Teacher Told Me")
=> #<Textbook created_at: , title: Lies My Teacher Told Me, author: , updated_at: , _id: , user_id: , copyright: >
>> t2.save
=> true
>> Textbook.all
=> [#<Textbook created_at: Wed Sep 23 14:54:25 UTC 2009, title: Lies My Teacher Told Me, author: , updated_at: Wed Sep 23 14:54:25 UTC 2009, _id: 4aba36a1477a51933f000007, user_id: , copyright: >]