Module: Errgonomic::Rails::ActiveRecordRelationFind

Defined in:
lib/errgonomic/rails/active_record_optional.rb

Overview

A relation and an association reach find without passing the class method, so the same list has to be unwrapped there as well.

Instance Method Summary collapse

Instance Method Details

#find(*ids, &block) ⇒ Object

Examples:

note = Note.create!(title: 'Death\'s End')
Note.where.not(title: nil).find([Some(note.id)]) == [note] # => true


704
705
706
# File 'lib/errgonomic/rails/active_record_optional.rb', line 704

def find(*ids, &block)
  super(*ids.map { |id| Errgonomic::Rails.unwrap_options(id) }, &block)
end