Module: EncodedId::Rails::QueryMethods
- Defined in:
- lib/encoded_id/rails/query_methods.rb
Instance Method Summary collapse
Instance Method Details
#where_encoded_id(slugged_encoded_id) ⇒ Object
6 7 8 9 10 |
# File 'lib/encoded_id/rails/query_methods.rb', line 6 def where_encoded_id(slugged_encoded_id) decoded_id = decode_encoded_id(slugged_encoded_id) raise ActiveRecord::RecordNotFound if decoded_id.nil? where(id: decoded_id) end |