Skip to content
Snippets Groups Projects
Commit 90fdb3d0 authored by Henk's avatar Henk
Browse files

support active_interaction 4

parent b7c79e8f
No related branches found
No related tags found
1 merge request!44Add stripped string type, add support for rails 6.1, appsignal 3 and active_interaction 4. Drop support for rails 5.1
# allow datetimes to be given as unix times for activeinteractions
module RoquaDateTimeAsUnixFilterExtension
def cast(value, interaction)
def cast(value, interaction, **options)
case value
when Numeric, /^[0-9]+$/
Time.at(value.to_i).to_datetime
when ''
super(nil, interaction)
super(nil, interaction, **options)
else
super
end
......@@ -15,12 +15,12 @@ ActiveInteraction::DateTimeFilter.include RoquaDateTimeAsUnixFilterExtension
# allow datetimes to be given as unix times as string
module RoquaTimeAsUnixFilterExtension
def cast(value, interaction)
def cast(value, interaction, **options)
case value
when /^[0-9]+$/
Time.at(value.to_i)
when ''
super(nil, interaction)
super(nil, interaction, **options)
else
super
end
......
......@@ -19,8 +19,8 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.required_ruby_version = '>= 2.5'
gem.add_dependency 'active_interaction', '~> 3.0'
gem.add_dependency 'activesupport', '>= 5.1', '< 6.1'
gem.add_dependency 'active_interaction', '>= 3.0', '< 5.0'
gem.add_dependency 'naught', '~> 1.0'
gem.add_dependency 'with_advisory_lock', '~> 3.2'
gem.add_dependency 'appsignal', '>= 2.9', '< 2.11'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment