class ActiveRecord::Base

Public Class Methods

marskal_find_association(p_association_symbol) click to toggle source

find the association within the current class ex: Contact.marskal_find_association(:contact_notes)

# File lib/marskal_search/marskal_active_record_extensions.rb, line 20
def self.marskal_find_association(p_association_symbol)
  l_ret = nil
  self.reflect_on_all_associations.each do |l_association|
    if l_association.name == p_association_symbol
      l_ret = l_association
      break
    end
  end
  l_ret
end