Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

map_to_primitive breaks when used with symbol.to_proc on ruby 2.4.0 #125

Open
fnordfish opened this issue Mar 16, 2017 · 0 comments
Open

Comments

@fnordfish
Copy link
Collaborator

This is due to a bug in ruby 2.4.0's instance_exec this code (taken from the samples) will fail:

$yaks = Yaks.new do
  map_to_primitive Date, Time, DateTime, ActiveSupport::TimeWithZone, &:iso8601
end

However, converting it to the more verbose syntax works just fine:

$yaks = Yaks.new do
  map_to_primitive Date, Time, DateTime, ActiveSupport::TimeWithZone do |t| t.iso8601 end
end
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant