I don't think we need to have specific cases to justify _was.  The purpose,
AFAIK, with the store accessors is to be transparent about whether they're
full columns or not.  For this reason, they should accommodate the same
methods, such as changed? and the _was methods to accurately reflect the
same API that attributes have.


On 20 August 2013 04:30, Mohamed Wael Khobalatte
<[email protected]>wrote:

> Do we have enough use cases to support adding the _was method?
>
>
> On Mon, Aug 19, 2013 at 11:10 PM, Nathan Broadbent 
> <[email protected]>wrote:
>
>> Dear Rails Core mailing list,
>>
>> I would like to propose some additions to the #store_accessor method, so
>> that also defines query and  _was methods.
>>
>> Example usage:
>>
>> class User < ActiveRecord::Base
>>   store :settings, accessors: [ :color, :homepage ], coder: JSON
>> end
>>
>> u = User.create(color: 'black', homepage: '37signals.com')
>>
>>
>>
>> u.color?  # => true
>>
>> u.color = 'white'
>> u.color_was  # => "black"
>>
>>
>> I can submit a PR if you support the change.
>>
>>
>> Thanks,
>> Nathan
>>
>>   --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/rubyonrails-core.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Mohamed Wael Khobalatte
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to