Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time-lord screws up active_support #16

Open
dmacvicar opened this issue Jul 24, 2013 · 1 comment
Open

time-lord screws up active_support #16

dmacvicar opened this issue Jul 24, 2013 · 1 comment

Comments

@dmacvicar
Copy link

I had the problem that I could not get Date#end_of_week to work on my program, but it did work on irb:

from my program:

(Date.today.beginning_of_week..Date.today.end_of_week)
=>  Mon, 22 Jul 2013..Sat, 13 Oct 2959

irb:

(Date.today.beginning_of_week..Date.today.end_of_week)
=> Mon, 22 Jul 2013..Sun, 28 Jul 2013

Then I realized:

(rdb:1) 1.method(:days).source_location
 ["/space/rbenv/versions/1.9.3-p194/lib64/ruby/gems/1.9.1/gems/time-lord-1.0.1/lib/time-lord/extensions/integer.rb", 3]

 [3] pry(main)> 1.method(:days).source_location 
 => ["/space/rbenv/versions/1.9.3-p194/lib64/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/numeric/time.rb",

I can then reproduce the wrong range by just loading time-lord.

@krainboltgreene
Copy link
Owner

While this is indeed an issue (I think), I would advise not using time-lord with active_support.

The goal of time-lord (and tardis) is to extract the time/date parts of active_support for non-rails apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants