Skip to content

Instantly share code, notes, and snippets.

@tyre
Created July 27, 2013 00:33
Show Gist options
  • Save tyre/6093129 to your computer and use it in GitHub Desktop.
Save tyre/6093129 to your computer and use it in GitHub Desktop.
class ImmutabilityValidator
def validate(record)
if record.persisted?
record.errors.add(:base, "#{record.class.name} cannot be updated after created.")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment