Method: ActiveHash::Relation#find_by_id
- Defined in:
- lib/active_hash/relation.rb
#find_by_id(id) ⇒ Object
129 130 131 132 133 134 135 |
# File 'lib/active_hash/relation.rb', line 129 def find_by_id(id) index = klass.send(:record_index)[id.to_s] # TODO: Make index in Base publicly readable instead of using send? return unless index record = all_records[index] record if conditions.matches?(record) end |