jlindley (owner)

Revisions

  • 51b297 jlindley Fri Jun 12 11:50:02 -0700 2009
gist: 128834 Download_button fork
public
Public Clone URL: git://gist.github.com/128834.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
june:dev> t = Tag.new
=> #<Tag id: nil, created_at: nil, updated_at: nil>
 
june:dev> s = Student.new
=> #<Student id: nil, created_at: nil, updated_at: nil>
 
june:dev> s.tags << t
=> [#<Tag id: nil, created_at: nil, updated_at: nil>]
 
june:dev> s.save
  Student Create (0.5ms) INSERT INTO "students" ("updated_at", "created_at") VALUES('2009-06-12 18:46:57', '2009-06-12 18:46:57')
  Tag Create (0.1ms) INSERT INTO "tags" ("updated_at", "created_at") VALUES('2009-06-12 18:46:57', '2009-06-12 18:46:57')
  Tagging Create (0.1ms) INSERT INTO "taggings" ("updated_at", "tag_id", "taggable_type", "taggable_id", "created_at") VALUES('2009-06-12 18:46:57', 4, 'Student', 4, '2009-06-12 18:46:57')
=> true