Closed yujideveloper closed 2 years ago
I have occurred unexpected ActiveHash::RecordNotFound exception when pass a block to ActiveFile::Base.find.
ActiveHash::RecordNotFound
ActiveFile::Base.find
class Country < ActiveYaml::Base set_filename "sample" end
- id: 1 name: US - id: 2 name: Canada - id: 3 name: Mexico
# Actual Çountry.find { |c| c.name == "US" } # => ActiveHash::RecordNotFound # Expected Çountry.find { |c| c.name == "US" } # => <Country:0x000000010686c7f0 @attributes={:id=>1, :name=>"US"}>
I fixed to pass a block to super method in ActiveFile::Base.find
super
Could you add a spec for this?
@kbrock I added specs. Could you review this?
ran with test locally, all passed
Thanks!
Problem
I have occurred unexpected
ActiveHash::RecordNotFound
exception when pass a block toActiveFile::Base.find
.Minimum reproduction code
This PR's changes
I fixed to pass a block to
super
method inActiveFile::Base.find