Class: Alchemy::IngredientAssociation

Inherits:
ActiveRecord::Associations::BelongsToAssociation
  • Object
show all
Defined in:
lib/alchemy/essence.rb

Overview

A bogus association that skips eager loading for essences not having an ingredient association

Instance Method Summary collapse

Instance Method Details

#klassObject

Skip eager loading if called by Rails’ preloader



9
10
11
12
13
14
15
# File 'lib/alchemy/essence.rb', line 9

def klass
  if caller.any? { |line| line =~ /preloader\.rb/ }
    nil
  else
    super
  end
end