Support for 'readonly' attributes
-
Sean O'Halpin
- State changed from new to resolved
Use the :readonly option (introduced in version 0.1.9):
require 'doodle' class Foo < Doodle counter = 0 has :uid, :readonly => true do init { counter += 1 } end end bar = Foo.new bar.uid # => 1 bar.uid = 2 # ~> -:12: Trying to set a readonly attribute: uid (Doodle::ReadOnlyError)Hmmm. I've had a look at the documentation and found that :readonly is not documented. Also, it fails to protect overwriting in certain edge cases (e.g. when you use #defer_validation).
-
Sean O'Halpin
Regarding your other points:
By all means tag a ticket with "feature" to denote a feature request.
I'd welcome any patches - no promises to incorporate them though ;)
-
Justin Ossevoort
Ah I was wondering how to do that, I'm more used to traditional issue tracking systems which have a clear classification, but I can see how tags help to simulate this ;-)
And great that the <:readonly> flag was already present, I guess I should have studied doodles core more ;-)
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.