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 doesn't work with ActiveSupport::TimeWithZone #40

Closed
AaronLasseigne opened this issue Aug 7, 2013 · 5 comments
Closed

time doesn't work with ActiveSupport::TimeWithZone #40

AaronLasseigne opened this issue Aug 7, 2013 · 5 comments
Assignees
Labels

Comments

@AaronLasseigne
Copy link
Owner

Time should be accepting both the Time class and ActiveSupport::TimeWithZone.

@AaronLasseigne
Copy link
Owner Author

Actually, Time doesn't even work.

@ghost ghost assigned AaronLasseigne Aug 7, 2013
@tfausak
Copy link
Collaborator

tfausak commented Aug 7, 2013

Wait, what?

class Interaction < ActiveInteraction::Base
  time :t
  def execute; t end
end
p Interaction.run!(t: Time.now)
# => 2013-08-07 11:41:28 -0500

@AaronLasseigne
Copy link
Owner Author

I'm digging more into it.

@AaronLasseigne
Copy link
Owner Author

This problem is specific to Rails.

@tfausak
Copy link
Collaborator

tfausak commented Aug 7, 2013

Confirmed:

require 'rubygems' # 2.0.6
require 'active_interaction' # 0.2.1
require 'rails' # 4.0.0
class Interaction < ActiveInteraction::Base
  time :t
end
Time.zone = 'UTC'
puts Interaction.run(t: 0).errors.full_messages
# => T is not a valid time

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

No branches or pull requests

2 participants