Thank you for the suggestion, but I think we don't need to add this to
Active Support since the implementation is really easy and I don't see
Rails or a lot of applications taking advantage of it.

Rafael Mendonça França
http://twitter.com/rafaelfranca
https://github.com/rafaelfranca


On Sun, Apr 28, 2013 at 7:17 PM, Rafa Perez <[email protected]>wrote:

> Just that:
>
> class Date
>>   def remaining_to(date)
>>     if date.acts_like? :date
>>       date - self
>>     end
>>   end
>>
>   alias :days_to
>
> end
>
>
> and then be able to do this:
>
> Date.today.remaining_to(Date.parse '2014-04-02').days.seconds
>
>
>
>  --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to