Skip to content

Commit

Permalink
Relation#explain no longer returns a string, but a Relation::ExplainP…
Browse files Browse the repository at this point in the history
…roxy. Calling #inspect will return the string, and is backwards compatible.
  • Loading branch information
botandrose-machine committed Feb 26, 2024
1 parent 8d32ada commit 3202d26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/awesome_nested_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1225,13 +1225,13 @@ def check_structure(entries, structure)
it "should sort by custom sort column" do
expect(OrderedCategory.acts_as_nested_set_options[:order_column]).to eq('name')
expect(OrderedCategory.order_column_name).to eq('name')
expect(OrderedCategory.first.children.explain).to include('ORDER BY name')
expect(OrderedCategory.first.children.explain.inspect).to include('ORDER BY name')
end

it "should sort by custom hash sort" do
expect(HashOrderedCategory.acts_as_nested_set_options[:order_column]).to eq({ :name => :desc })
expect(HashOrderedCategory.order_column_name).to eq({ :name => :desc })
expect(HashOrderedCategory.first.children.explain).to include(
expect(HashOrderedCategory.first.children.explain.inspect).to include(
"ORDER BY #{HashOrderedCategory.quoted_table_name}.#{HashOrderedCategory.connection.quote_column_name(:name)} DESC"
)
end
Expand Down

0 comments on commit 3202d26

Please sign in to comment.