Sha256: 17472fb8902b051d5bbbb1470ecdea7a938af9f7ec7e1f24466df3e2b0c4f7dd

Contents?: true

Size: 304 Bytes

Versions: 2

Compression:

Stored size: 304 Bytes

Contents

module MadID::FinderMethods

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

  def mad_id_column
    @mad_id_column || 'id'
  end

  def mad_id_column=(val)
    @mad_id_column = val
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mad_id-1.1.1 lib/mad_id/finder_methods.rb
mad_id-1.1.0 lib/mad_id/finder_methods.rb