Module: MadID::FinderMethods

Defined in:
lib/mad_id/finder_methods.rb

Instance Method Summary collapse

Instance Method Details

#find_by_mad_id(id) ⇒ Object



6
7
8
# File 'lib/mad_id/finder_methods.rb', line 6

def find_by_mad_id(id)
  find_by(mad_id_column => id.to_s.downcase)
end

#find_by_mad_id!(id) ⇒ Object



3
4
5
# File 'lib/mad_id/finder_methods.rb', line 3

def find_by_mad_id!(id)
  find_by!(mad_id_column => id.to_s.downcase)
end

#mad_id_columnObject



10
11
12
# File 'lib/mad_id/finder_methods.rb', line 10

def mad_id_column
  @mad_id_column || 'id'
end

#mad_id_column=(val) ⇒ Object



14
15
16
# File 'lib/mad_id/finder_methods.rb', line 14

def mad_id_column=(val)
  @mad_id_column = val
end