Sha256: 34f296412979aa4a24c16a3ea5566d11042c0e686ca19fa0f89764ef1048991b
Contents?: true
Size: 457 Bytes
Versions: 4
Compression:
Stored size: 457 Bytes
Contents
module Microscope class InstanceMethod < Struct.new(:model, :field) # Inject ActiveRecord scopes into a model def self.inject_instance_methods(model, fields, options = {}) fields.each do |field| scope = "#{field.type.to_s.camelize}InstanceMethod" if Microscope::InstanceMethod.const_defined?(scope) "Microscope::InstanceMethod::#{scope}".constantize.new(model, field).apply end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems