module Bullet class Association class < [#{associations.map(&:inspect).join(', ')}]" end def associations_str(associations) ":include => #{associations.map{|a| a.to_sym unless a.is_a? Hash}.inspect}" end def unique(array) array.flatten! array.uniq! end def unpreload_associations @@unpreload_associations ||= {} end def unused_preload_associations @@unused_preload_associations ||= {} end def object_associations @@object_associations ||= {} end def call_object_associations @@call_object_associations ||= {} end def possible_objects @@possible_objects ||= {} end def impossible_objects @@impossible_objects ||= {} end def klazz_associations @@klazz_associations ||= {} end def eager_loadings @@eager_loadings ||= {} end VENDOR_ROOT = File.join(RAILS_ROOT, 'vendor') def caller_in_project callers << caller.select {|c| c =~ /#{RAILS_ROOT}/}.reject {|c| c =~ /#{VENDOR_ROOT}/} callers.uniq! end def callers @@callers ||= [] end end end end