lib/api_resource/scopes.rb in api_resource-0.5.1 vs lib/api_resource/scopes.rb in api_resource-0.6.0
- old
+ new
@@ -2,10 +2,11 @@
module Scopes
extend ActiveSupport::Concern
module ClassMethods
+ # TODO: calling these methods should force loading of the resource definition
def scopes
return self.related_objects[:scopes]
end
def scope?(name)
@@ -59,12 +60,11 @@
# if we have nothing at this point we should just pass 'true'
if finder_opts[scope_name] == {}
finder_opts[scope_name] = true
end
- ApiResource::Associations::ResourceScope.new(
- self, finder_opts
- )
+ ApiResource::Conditions::ScopeCondition.new(finder_opts, self)
+
end
end
end
end