Skip to content

Instantly share code, notes, and snippets.

@paul
Created November 23, 2008 23:35
Show Gist options
  • Save paul/28319 to your computer and use it in GitHub Desktop.
Save paul/28319 to your computer and use it in GitHub Desktop.
def self.all(query = {})
if query.has_key?(:visible_to?)
account = query.delete(:visible_to?)
end
set = super
set.select { |o| o.visible_to?(account) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment