Module: Frenetic::Behaviors::AlternateStringIdentifier
- Defined in:
- lib/frenetic/behaviors/alternate_string_identifier.rb
Instance Method Summary collapse
Instance Method Details
#finder_params(unique_id, alternate_key) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/frenetic/behaviors/alternate_string_identifier.rb', line 41 def finder_params(unique_id, alternate_key) return unique_id if unique_id.is_a? Hash params = {} return params if unique_id.blank? key = if unique_id.to_i.to_s == unique_id.to_s :id elsif !unique_id.nil? alternate_key end params[key] = unique_id params end |