Module: Louisville::Extensions::Finder

Defined in:
lib/louisville/extensions/finder.rb

Defined Under Namespace

Modules: ClassMethods, RelationMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/louisville/extensions/finder.rb', line 15

def self.included(base)
  base.extend ClassMethods
  base.class_eval do
    class << self
      alias_method_chain :relation, :louisville_finder

      if ActiveRecord::VERSION::MAJOR >= 4 && ActiveRecord::VERSION::MINOR >= 2
        alias_method_chain :find, :louisville_finder
      end

    end
  end
end