Will, I should probably explain the change because I was the one who introduced it in the first place.
The reason for the changes to the NumberHelper was that I wasn't happy with them being inconsistent - some helpers would use hashes to supply optional parameters and some would use a "standard" argument list. In Rails - and nowadays also in many Ruby libraries, as far as I've seen - it has become some kind of a best practice to only use fixed parameters for required parameters (e.g. the number in the number helpers) and supply optional parameters as an options hash - which is exactly what all NumberHelper methods do since I made the change. If I remember correctly, I introduced similar changes in other places in ActionView. In short: This is deprecation for the sake of deprecation but for the sake of consolidating the ActionView helpers API which - in my opinion - makes plenty of sense and is a valid reason for deprecation, even if it occasionally results in some verbosity like you indicated. I hope this explains the change sufficiently. Otherwise maybe Josh would like to chime in since he was the one who committed it. - Clemens On Nov 16, 10:40 pm, "Will Bryant" <[EMAIL PROTECTED]> wrote: > Hi guys, > 2.2 has the new number_with_precision implementation which after the number > takes :precision, :separator, and :delimiter hash arguments instead of just > a precision integer, and the old argument format has been deprecated. > > Are we really on the right track deprecating things like this? It feels > like deprecation for the sake of deprecation to me. > > I mean, if you've got a method called number_with_precision, it seems pretty > clear that the normal two arguments would be the number, and the precision. > Being able to supply the separator and delimiter is great, but since most > people will just set those on the locale (if at all), surely we're just > making people do a bunch of extra typing & change a _lot_ of calls in their > existing code for no good reason, merely to get rid of the deprecation? > > The code already supports both argument syntaxes, so I think we should just > remove the deprecation warning. IMHO, we don't have to deprecate every time > something slightly more flexible comes along if there's nothing wrong with > the old way - provided there's no confusion between the old & new syntax or > semantics. > > Will --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
