This commit (f5f7c40f3aedf88b2aef4e83602a4f41ffa5d0ab) introduces a
new limitation for ActiveRecord::Base instances that has (to my
knowledge) never been discussed.

Briefly: an error on an attribute cannot be set as the result of an
exception computing the value of the attribute.

For example:

def v
    compute_it
  rescue
    errors.add(:v, "Dadgummit")
end

After the aforementioned commit, when compute_it raise an exception,
ActiveRecord::Error#initialize references v, which in turn raises
another exception, which adds another error, which in turn proves that
my stack is not infinitely deep.

Is it reasonable to assume that ActiveRecord::Error instances can
reference its erroneous attribute's value? If so, the above pattern
won't work and instead a sentinel value will need to be set (U-G-L-Y).

You can see the background of this commit on ticket #3147 here:
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3147
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to