Skip to content

Instantly share code, notes, and snippets.

@calas
Created February 19, 2009 02:12
Show Gist options
  • Save calas/66681 to your computer and use it in GitHub Desktop.
Save calas/66681 to your computer and use it in GitHub Desktop.
# parent model
def readonly?
state == "closed" && !changed.include?('state')
end
# child model
def readonly?
# ...
parent.state == "closed"
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment