Sha256: 47132f083186449884631df84f48d08a0db1a0e72583583e8b168c50a2df0835
Contents?: true
Size: 466 Bytes
Versions: 7
Compression:
Stored size: 466 Bytes
Contents
module Merit class BaseTargetFinder def self.find(*args) self.new(*args).find end def initialize(rule, action) @rule = rule @action = action end def find klass_name = (@rule.model_name || @action.target_model).singularize klass = klass_name.camelize.constantize klass.find_by_id @action.target_id rescue => e Rails.logger.warn "[merit] no target found: #{e}. #{caller.first}" end end end
Version data entries
7 entries across 7 versions & 1 rubygems