Guest User

Untitled

a guest
Jul 15th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. 21:13:34 enl@isengard:~/tmp/cats> sequel -E sqlite://test.db -L .
  2. ./init.rb:5: warning: already initialized constant DB
  3. I, [2009-10-25T21:13:49.577548 #2382] INFO -- : PRAGMA table_info('chapters')
  4. I, [2009-10-25T21:13:49.579738 #2382] INFO -- : PRAGMA table_info('categories')
  5. I, [2009-10-25T21:13:49.581778 #2382] INFO -- : PRAGMA table_info('posts')
  6. Your database is stored in DB...
  7. 001:0> p = Chapter.eager(:categories).all
  8. I, [2009-10-25T21:14:07.951787 #2382] INFO -- : SELECT * FROM `chapters`
  9. I, [2009-10-25T21:14:07.953633 #2382] INFO -- : SELECT * FROM `categories` WHERE (`categories`.`chapter_id` IN (1, 2))
  10. [#<Chapter @values={:id=1, :text="ch1"}, #<Chapter @values={:id=>2, :text=>"ch2"}]
  11. 002:0> p.each {|x| x.categories.each {|y| puts y.text}}
  12. [#<Chapter @values={:id=1, :text="ch1"}, #<Chapter @values={:id=>2, :text=>"ch2"}]
  13. 003:0>
Add Comment
Please, Sign In to add comment