Skip to content

Instantly share code, notes, and snippets.

@pupca
Created December 8, 2010 09:30
Show Gist options
  • Save pupca/733081 to your computer and use it in GitHub Desktop.
Save pupca/733081 to your computer and use it in GitHub Desktop.
has_many :tags, :conditions => ["person_id IN(?)", (self.accounting_sharing_with.nil? ? self.id : (self.accounting_sharing_with + self))]
@pupca
Copy link
Author

pupca commented Dec 8, 2010

Person Load (0.4ms) SELECT * FROM people LIMIT 1
Tag Load (0.2ms) SELECT * FROM tags WHERE (tags.person_id = 1 AND (person_id IN('--- !ruby/object:Proc {}

')))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment