On Thursday, April 19, 2012 11:50:13 AM UTC-7, Jeremy Evans wrote:
>
> On Thursday, April 19, 2012 9:43:49 AM UTC-7, Rodrigo Rosenfeld Rosas 
> wrote:
>
>> For example, take a look at this AR model excerpt:
>>
>>   after_update :remove_options_if_changed_type_was_options
>> private
>>   def remove_options_if_changed_type_was_options
>>     options.clear if type_changed? && type_was == 'options'
>>   end
>>
>> I've even asked for a type_was? method in a Rails pull request at that 
>> time:
>>
>> https://github.com/rails/rails/pull/5763
>>
>
> Sequel currently doesn't provide a similar feature, as it doesn't save 
> previous values of columns.  It's probably not difficult to add a plugin 
> that would do so, though.
>

Here's my first attempt, with specs but no documentation yet: 
http://pastie.org/3819298

If anyone could review this diff and provide feedback before I commit it, I 
would appreciate it.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/17BJREOHE-AJ.
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.

Reply via email to