Skip to content

Commit

Permalink
more hound fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciomacadden committed Dec 15, 2023
1 parent 87f0a27 commit 6517cc5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
8 changes: 4 additions & 4 deletions lib/administrate/base_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ def item_includes

def item_associations
attributes = if show_page_attributes.is_a?(Hash)
show_page_attributes.values.flatten
else
show_page_attributes
end
show_page_attributes.values.flatten
else
show_page_attributes
end
attribute_associated attributes
end

Expand Down
28 changes: 13 additions & 15 deletions spec/example_app/app/dashboards/order_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,22 @@ class OrderDashboard < Administrate::BaseDashboard
]

FORM_ATTRIBUTES = {
"" => [
:customer,
"" => %i[customer],
"details" => %i[
line_items
shipped_at
payments
],
"details" => [
:line_items,
:shipped_at,
:payments,
"address" => %i[
address_line_one
address_line_two
address_city
address_state
address_zip
],
"address" => [
:address_line_one,
:address_line_two,
:address_city,
:address_state,
:address_zip,
],
}
}.freeze
SHOW_PAGE_ATTRIBUTES = FORM_ATTRIBUTES.merge(
"" => %i[customer created_at updated_at],
"details" => %i[line_items total_price shipped_at payments],
)
).freeze
end
8 changes: 4 additions & 4 deletions spec/lib/pages/form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

it "returns the attributes from FORM_ATTRIBUTES_NEW" do
expect(attributes).to match(
{ "" => %i[
"" => %i[
order
product
] },
],
)
end
end
Expand All @@ -50,11 +50,11 @@

it "returns the attributes from FORM_ATTRIBUTES_EDIT" do
expect(attributes).to match(
{ "" => %i[
"" => %i[
order
product
quantity
] },
],
)
end
end
Expand Down

0 comments on commit 6517cc5

Please sign in to comment.