class Counter::Cache::Counters::BufferCounter::RelationFinder

Public Instance Methods

relation_class() click to toggle source
# File lib/counter/cache/counters/buffer_counter/relation_finder.rb, line 6
def relation_class
  return options.relation_class_name if options.relation_class_name
  return polymorphic_type if options.polymorphic?
  reflection_type
end
relation_id() click to toggle source
# File lib/counter/cache/counters/buffer_counter/relation_finder.rb, line 12
def relation_id
  options.relation_id || source_object.send("#{options.relation}_id")
end

Private Instance Methods

polymorphic_type() click to toggle source
# File lib/counter/cache/counters/buffer_counter/relation_finder.rb, line 18
def polymorphic_type
  source_object.send("#{options.relation}_type")
end
reflection_type() click to toggle source
# File lib/counter/cache/counters/buffer_counter/relation_finder.rb, line 22
def reflection_type
  source_object.class.reflections[options.relation.to_sym].class_name.to_s.camelize # let AR give us the correct class name :)
end