Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # With a subselect
- @authors = Author.find(:all, :conditions => %{id in (
- select e.author_id from extensions e where e.size != 0
- )})
- # With the :joins key
- @authors = Author.find(:all, {
- :joins => 'extensions on extensions.author_id = authors.id',
- :conditions => 'extensions.size != 0',
- :readonly => false # Not sure why :joins key implies ":readonly => true"
- })
Add Comment
Please, Sign In to add comment