active-hash / active_hash

A readonly ActiveRecord-esque base class that lets you use a hash, a Yaml file or a custom file as the datasource
MIT License
1.21k stars 179 forks source link

feat: improve pp output for ActiveHash::Relation #288

Closed flavorjones closed 1 year ago

flavorjones commented 1 year ago

Previously the output might look like:

#<ActiveHash::Relation:0x00007f4c2dc3ca28
 @all_records=
  [#<Layout:0x00007f4c2df4f198 @attributes={:id=>1, :name=>"1"}>,
   #<Layout:0x00007f4c2df4cfd8 @attributes={:id=>2, :name=>"2"}>,
   #<Layout:0x00007f4c2df4b9a8 @attributes={:id=>3, :name=>"3"}>,
   #<Layout:0x00007f4c2df7d9f8 @attributes={:id=>4, :name=>"4"}>],
 @conditions=#<ActiveHash::Relation::Conditions:0x00007f4c2dc3bd58 @conditions=[]>,
 @klass=Layout,
 @order_values=[]>

After this change the output looks like:

[#<Layout:0x00007f2755785d60 @attributes={:id=>1, :name=>"1"}>,
 #<Layout:0x00007f2755784668 @attributes={:id=>2, :name=>"2"}>,
 #<Layout:0x00007f2755783a38 @attributes={:id=>3, :name=>"3"}>,
 #<Layout:0x00007f2755782db8 @attributes={:id=>4, :name=>"4"}>]

Closes #285