lib/notification_renderer/notification_scopes.rb in notification-renderer-1.0.0.beta8 vs lib/notification_renderer/notification_scopes.rb in notification-renderer-1.0.0.beta9
- old
+ new
@@ -1,17 +1,27 @@
module NotificationRenderer
module NotificationScopes
-
- def method_missing m, *args
- if m.to_s[/(.+)_type/]
- where type: $1.singularize.classify
- else
- super
- end
+
+ extend ActiveSupport::Concern
+
+ included do
+ include NotificationRenderer::NotificationScopes::InstanceMethods
end
- def respond_to? m, include_private = false
- super || m.to_s[/(.+)_type/]
+ module InstanceMethods
+
+ def method_missing m, *args
+ if m.to_s[/(.+)_type/]
+ where type: $1.singularize.classify
+ else
+ super
+ end
+ end
+
+ def respond_to? m, include_private = false
+ super || m.to_s[/(.+)_type/]
+ end
+
end
-
+
end
end