Sha256: a5398244102db81527b1d6072331c216b84e4c9dc335c6ff84e6301daf77d99c
Contents?: true
Size: 663 Bytes
Versions: 10
Compression:
Stored size: 663 Bytes
Contents
# allow datetimes to be given as unix times for activeinteractions module RoquaDateTimeAsUnixFilterExtension def cast(value) case value when Numeric, /^[0-9]+$/ Time.at(value.to_i).to_datetime when '' super(nil) else super end end end ActiveInteraction::DateTimeFilter.include RoquaDateTimeAsUnixFilterExtension # allow datetimes to be given as unix times as string module RoquaTimeAsUnixFilterExtension def cast(value) case value when /^[0-9]+$/ Time.at(value.to_i) when '' super(nil) else super end end end ActiveInteraction::TimeFilter.include RoquaTimeAsUnixFilterExtension
Version data entries
10 entries across 10 versions & 1 rubygems