lib/notification_settings/notification_scopes.rb in notification-settings-1.0.0.beta8 vs lib/notification_settings/notification_scopes.rb in notification-settings-1.0.0.beta9

- old
+ new

@@ -1,17 +1,27 @@ module NotificationSettings module NotificationScopes - def method_missing m, *args - if m.to_s[/(.+)_category/] - where category: $1.singularize.classify - else - super - end + extend ActiveSupport::Concern + + included do + include NotificationSettings::NotificationScopes::InstanceMethods end - def respond_to? m, include_private = false - super || m.to_s[/(.+)_category/] + module InstanceMethods + + def method_missing m, *args + if m.to_s[/(.+)_category/] + where category: $1.singularize.classify + else + super + end + end + + def respond_to? m, include_private = false + super || m.to_s[/(.+)_category/] + end + end end end