while we're at it, I propose to alias :new_record? as :new? and 
:existing_record? as :exists?



Cheers,
Lawrence Pit

> This one:
>
> http://rails.lighthouseapp.com/projects/8994/tickets/2228-activerecordbasesaved
>
> Looks like we have three different patches for the same purpose.
> Hackers unite!
>
> My vote is still for "existing_record?" :)
>
> On Mar 18, 4:16 pm, RSL <[email protected]> wrote:
>   
>> was it this patch here?
>>
>> http://rails.lighthouseapp.com/projects/8994/tickets/2089-add-arbasej...
>>
>> RSL
>>
>> On Wed, Mar 18, 2009 at 11:11 AM, José Valim <[email protected]> wrote:
>>
>>     
>>> +1 for existing_record?.
>>>       
>>> I think I already saw a patch about "existing_record?" in lighthouse.
>>>       
>>> On Mar 18, 4:04 pm, Mislav Marohnić <[email protected]> wrote:
>>>       
>>>> On Wed, Mar 18, 2009 at 13:12, Olly Legg <[email protected]> wrote:
>>>>         
>>>>> It is along the same lines as the invalid? method. It adds a more
>>>>> readable method for the opposite functionality.
>>>>>           
>>>> The name "saved_record?" might be misleading -- developers might think
>>>>         
>>> that
>>>       
>>>> this method returns false before the "save" method was called and true
>>>>         
>>> after
>>>       
>>>> the call:
>>>>         
>>>>   user.saved_record? # => false
>>>>   user.save
>>>>   user.saved_record? # => true
>>>>         
>>>> Of course, this is not what the method does ("dirty?" should be used for
>>>> this).
>>>>         
>>>> Why not "existing_record?"
>>>>         
>>>>   user = User.new
>>>>   user.existing_record? # => false
>>>>   user.save
>>>>   user.existing_record? # => true
>>>>         
>>>> Sounds much better.
>>>>         
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to