Sha256: d4701689d80e06d1c82212d26c597931663b0f79adfa93b4514ebf4c12641ce4

Contents?: true

Size: 473 Bytes

Versions: 1

Compression:

Stored size: 473 Bytes

Contents

require 'old_api_resource/associations/scope'

module OldApiResource
  
  module Associations
    
    class ResourceScope < Scope
      
      include Enumerable

      def internal_object
        @internal_object ||= self.klass.send(:find, :all, :params => self.scopes[self.current_scope])
      end
      
      alias_method :all, :internal_object
      
      def each(*args, &block)
        self.internal_object.each(*args, &block)
      end

    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
old_api_resource-0.3.0 lib/old_api_resource/associations/resource_scope.rb