According to all the documentation and tutorials I've found, defining the following method in my ActiveRecord subclass (AuthenticationToken
) should prevent saving changes to an existing record, but not prevent it from being created or destroyed:
def readonly?
!new_record?
end
However, calling token.destroy
throws "AuthenticationToken is marked as readonly"
. For now I am using token.delete
, which is acceptable because the model has no children, but I'd like to be able to use destroy. I'm using Rails 4.2.5.