diff --git a/app/helpers/recurring_select_helper.rb b/app/helpers/recurring_select_helper.rb index b4fc7e70..467c13cd 100644 --- a/app/helpers/recurring_select_helper.rb +++ b/app/helpers/recurring_select_helper.rb @@ -2,7 +2,7 @@ module RecurringSelectHelper module FormHelper - if Rails::VERSION::MAJOR == 4 + if Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5 def select_recurring(object, method, default_schedules = nil, options = {}, html_options = {}) RecurringSelectTag.new(object, method, self, default_schedules, options, html_options).render end @@ -12,7 +12,7 @@ def select_recurring(object, method, default_schedules = nil, options = {}, html end end end - + module FormBuilder def select_recurring(method, default_schedules = nil, options = {}, html_options = {}) if !@template.respond_to?(:select_recurring) @@ -114,7 +114,11 @@ def initialize(object, method, template_object, default_schedules = nil, options end def render - option_tags = add_options(recurring_options_for_select(value(object), @default_schedules, @options), @options, value(object)) + if Rails::VERSION::STRING >= '5.2' + option_tags = add_options(recurring_options_for_select(value, @default_schedules, @options), @options, value) + else + option_tags = add_options(recurring_options_for_select(value(object), @default_schedules, @options), @options, value(object)) + end select_content_tag(option_tags, @options, @html_options) end end diff --git a/lib/recurring_select/version.rb b/lib/recurring_select/version.rb index 86e59cce..3e6c68a6 100644 --- a/lib/recurring_select/version.rb +++ b/lib/recurring_select/version.rb @@ -1,3 +1,3 @@ module RecurringSelect - VERSION = "2.0.0" + VERSION = "2.1.0" end