Sha256: cf187537c37765c1ed94b492e3ce9910c0aec32213df9eca6b39bf907b765b70

Contents?: true

Size: 398 Bytes

Versions: 28

Compression:

Stored size: 398 Bytes

Contents

module Hobo

  module Scopes

    module ApplyScopes

      def apply_scopes(scopes)
        result = self
        scopes.each_pair do |scope, arg|
          if arg.is_a?(Array)
            result = result.send(scope, *arg) unless arg.first.blank?
          else
            result = result.send(scope, arg) unless arg.blank?
          end
        end
        result
      end

    end

  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hobo-1.1.0 lib/hobo/scopes/apply_scopes.rb
hobo-1.0.3 lib/hobo/scopes/apply_scopes.rb
hobo-1.1.0.pre4 lib/hobo/scopes/apply_scopes.rb
hobo-1.1.0.pre3 lib/hobo/scopes/apply_scopes.rb
hobo-1.1.0.pre2 lib/hobo/scopes/apply_scopes.rb
hobo-1.1.0.pre0 lib/hobo/scopes/apply_scopes.rb
hobo-1.0.2 lib/hobo/scopes/apply_scopes.rb
hobo-1.0.1 lib/hobo/scopes/apply_scopes.rb
hobo-1.0.0 lib/hobo/scopes/apply_scopes.rb
hobo-0.9.106 lib/hobo/scopes/apply_scopes.rb
hobo-0.9.105 lib/hobo/scopes/apply_scopes.rb
hobo-0.9.104 lib/hobo/scopes/apply_scopes.rb
hobo-0.9.103 lib/hobo/scopes/apply_scopes.rb
hobo-0.9.102 lib/hobo/scopes/apply_scopes.rb
hobo-0.9.101 lib/hobo/scopes/apply_scopes.rb
hobo-0.9.100 lib/hobo/scopes/apply_scopes.rb
hobo-0.9.0 lib/hobo/scopes/apply_scopes.rb
hobo-0.8.10 lib/hobo/scopes/apply_scopes.rb
hobo-0.8.9 lib/hobo/scopes/apply_scopes.rb
hobo-0.8.8 lib/hobo/scopes/apply_scopes.rb