Hi David and Jeremy! David, You are not the only one who need this functionality :) The []= method was even simpler originally. I proposed that change (when the repo was on Google yet) so that the new value should be compared to the stored one before updating changed_columns. It worked fine until typecast_value was introduced.
Seeing all the problems You see now I made a patch in last december. I implemented the feature introducing a Hash sublass for @values and I encapsulated all functionality into it. It solved all the problems You listed (except the gsub one) but Jeremy wrote that it is too much code for such a minor feature and didn't applied it. I agree with Him. My solution was overkill since I made it to be foolproof. Now I have a plugin which stores the original values (saved_values) at initialization (I need the saved_values for implementing some kind of auditing and mantaining history of a Model and in another plugin also). I like Your solution! It's much simpler than mine and provides almost the same functionality. I'd like to have the saved_values to be public. I need it in several applications and in my own plugins. Having this functionality in a standard plugin would be nice! Tamás On Sat, Jul 25, 2009 at 12:13 AM, David Lee <[email protected]> wrote: > > I just added #saved_values and #changes because they were easy to > implement given the new way to detect changes. > Those methods don't have to be added (#saved_values can just be > private). > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" 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/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
