diff --git a/lib/active_record/acts_as/relation.rb b/lib/active_record/acts_as/relation.rb index 3a0eaa5..6589854 100644 --- a/lib/active_record/acts_as/relation.rb +++ b/lib/active_record/acts_as/relation.rb @@ -4,7 +4,7 @@ module Relation extend ActiveSupport::Concern module ClassMethods - def acts_as(name, scope = nil, options = {}) + def acts_as(name, scope = nil, **options) options, scope = scope, nil if Hash === scope association_method = options.delete(:association_method) @@ -84,6 +84,8 @@ def is_a?(klass) end def actable(scope = nil, **options) + options, scope = scope, nil if Hash === scope + name = options.delete(:as) || :actable reflections = belongs_to(name, scope, **options.reverse_merge(validate: false,