Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temporary fix for TangibleThing order #409

Merged
merged 3 commits into from
Aug 17, 2023

Conversation

gazayas
Copy link
Contributor

@gazayas gazayas commented Aug 16, 2023

#408

I'm not entirely sure why the records are being returned in descending order, and my tests are failing locally but CI seems to be passing. Accessing TangibleThings via their CreativeConcept will return them in descending order:

In the CreativeConcept show action:
From: /Users/gabriel_zayas/work/bt/bullet_train/local/bullet_train-core/bullet_train-super_scaffolding/app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb:17 Account::Scaffolding::AbsolutelyAbstract::CreativeConceptsController#show:

    16: def show
 => 17:   binding.pry
    18: end

[1] pry(#<Account::Scaffolding::AbsolutelyAbstract::CreativeConceptsController>)> Scaffolding::CompletelyConcrete::TangibleThing.where(absolutely_abstract_creative_concept_id: @creative_concept.id)
=> [#<Scaffolding::CompletelyConcrete::TangibleThing:0x0000000112b17a98
  id: 320,
  absolutely_abstract_creative_concept_id: 30,
  text_field_value: "Test 21",
  button_value: nil,
  cloudinary_image_value: nil,
  date_field_value: nil,
  email_field_value: nil,
  password_field_value: nil,
  phone_field_value: nil,
  super_select_value: nil,
  text_area_value: nil,
  created_at: Wed, 16 Aug 2023 09:41:44.055014000 UTC +00:00,
  updated_at: Wed, 16 Aug 2023 09:41:44.055014000 UTC +00:00,
  sort_order: nil,
  date_and_time_field_value: nil,
  multiple_button_values: [],
  multiple_super_select_values: [],
  color_picker_value: nil,
  boolean_button_value: nil,
  option_value: nil,
  multiple_option_values: []>,
 #<Scaffolding::CompletelyConcrete::TangibleThing:0x0000000112b17958
  id: 319,
  absolutely_abstract_creative_concept_id: 30,
  text_field_value: "Test 20",
  button_value: nil,
  cloudinary_image_value: nil,
  date_field_value: nil,
  email_field_value: nil,
  password_field_value: nil,
  phone_field_value: nil,
  super_select_value: nil,
  text_area_value: nil,
  created_at: Wed, 16 Aug 2023 09:41:44.050715000 UTC +00:00,
  updated_at: Wed, 16 Aug 2023 09:41:44.050715000 UTC +00:00,
  sort_order: nil,
  date_and_time_field_value: nil,
  multiple_button_values: [],
  multiple_super_select_values: [],
  color_picker_value: nil,
  boolean_button_value: nil,
  option_value: nil,
  multiple_option_values: []>,

  ...

The records are returned in the correct order when calling the following though:

Scaffolding::CompletelyConcrete::TangibleThing.all

I'm not seeing anything in the scopes or controllers that could be causing this, so this is a temporary fix that will return our records in the correct order for the time being.

@jagthedrummer jagthedrummer merged commit f2d0844 into main Aug 17, 2023
1 check passed
@jagthedrummer jagthedrummer deleted the fixes/tangible-thing-order branch August 17, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants