On L, 2008-04-26 at 13:10 +0100, Frederick Cheung wrote:
> I noticed that [8863] remove the :except and :only options from
> ActiveRecord::Base#attributes (and it makes perfect since not to
> duplicate Hash#except/slice in there). #attributes still takes an
> options parameter, but just ignores it, which could lead to a tricky
> to diagnose error further down the line. Could a deprecation notice
> not be issued (or make attributes not take an options parameter to
> that ArgumentError is raised if people try) to make this easier to spot?
I pointed this issue out in #rails-core but noone responded.
The strip_attributes[1] plugin is the only place I've seen using
this feature; with [8863] the plugin would actually misbehave
silently (stripping all attributes).
I think the option should be removed, and an appropriate upgrade
strategy described in the release notes.
An alternative would be to do something like this:
def attributes(options=nil)
if options
raise ArgumentError, 'The options argument is no longer accepted,
please use Hash#except or Hash#slice'
..
But I'd prefer the fiest approach as the simple fact that
the feature was removed suggests that it is not commonly used
and as such does not need special attention.
[1] http://rubyforge.org/projects/stripattributes
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---