Sha256: c50f7981e2bc5f133899f15b2973dac4087f3475163876929b0862df07a7d9f3
Contents?: true
Size: 411 Bytes
Versions: 1
Compression:
Stored size: 411 Bytes
Contents
module Microscope class Scope < Struct.new(:model, :field) # Inject ActiveRecord scopes into a model def self.inject_scopes(model, fields, options = {}) fields.each do |field| scope = "#{field.type.to_s.camelize}Scope" if Microscope::Scope.const_defined?(scope) "Microscope::Scope::#{scope}".constantize.new(model, field).apply end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
microscope-0.4 | lib/microscope/scope.rb |