Skip to content

Instantly share code, notes, and snippets.

@JeanMertz
Created June 6, 2011 11:54
Show Gist options
  • Save JeanMertz/1010131 to your computer and use it in GitHub Desktop.
Save JeanMertz/1010131 to your computer and use it in GitHub Desktop.
override children
def children(logged_in = true)
if logged_in
account.pages.where(parent_id: self.id)
else
account.pages.where(parent_id: self.id, is_active: true)
end
end
@page.children(logged_in?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment