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

🐛 Marketplace: ActionView::Template::Error: undefined method `delivery_window' for {"order_by"=>"Wednesday at 5PM", "notify_emails"=>"hello+p... #1269

Closed
sentry-io bot opened this issue Mar 27, 2023 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Mar 27, 2023

NoMethodError: undefined method `delivery_window' for {"order_by"=>"Wednesday at 5PM", "notify_emails"=>"hello+piikup-sandbox-orders@zinc.coop", "delivery_window"=>"2023-03-20T10:00:00.000+00:00", "delivery_fee_cents"=>1000}:Hash
  app/furniture/marketplace/marketplace.rb:14:in `delivery_window'
    delegate :delivery_fee_cents, :delivery_fee_cents=,
  app/furniture/marketplace/carts/_cart.html.erb:6:
    <%= render "datetime_field", attribute: :delivery_window, form: cart_form, disabled?: cart.marketplace.delivery_window.present? %>
  app/furniture/marketplace/carts/_cart.html.erb:4:
    <%= form_with model: cart.location do |cart_form| %>
  app/furniture/marketplace/marketplaces/_marketplace.html.erb:9:
    <%= render cart %>
  app/views/furnitures/_furniture.html.erb:34:
    <%= render furniture.furniture %>
...
(217 additional frame(s) were not displayed)

ActionView::Template::Error: undefined method `delivery_window' for {"order_by"=>"Wednesday at 5PM", "notify_emails"=>"hello+piikup-sandbox-orders@zinc.coop", "delivery_window"=>"2023-03-20T10:00:00.000+00:00", "delivery_fee_cents"=>1000}:Hash
@anaulin
Copy link
Member

anaulin commented Mar 27, 2023

Related to #1265 (comment) and #1266 -- something isn't working right with the method delegation to settings, and we're still throwing 500s. 😿

@anaulin anaulin changed the title ActionView::Template::Error: undefined method `delivery_window' for {"order_by"=>"Wednesday at 5PM", "notify_emails"=>"hello+p... 🐛 Marketplace: ActionView::Template::Error: undefined method `delivery_window' for {"order_by"=>"Wednesday at 5PM", "notify_emails"=>"hello+p... Mar 27, 2023
@zspencer zspencer added the 🐞 bug Something isn't working label Mar 27, 2023
zspencer added a commit that referenced this issue Mar 27, 2023
- https://zinc-collective.sentry.io/issues/4031191037/?project=6052513
- #1265
- #1185
- #1269

So, it turns out the reason we were getting these errors was because I
had not made the form picker smart enough to use the string value when a
delivery window was not present.

Now it is!

Also, reverting the StoreModel stuff because it did not seem to fix the
problem and I can't figure out why it's not working :'(
zspencer added a commit that referenced this issue Mar 28, 2023
- https://zinc-collective.sentry.io/issues/4031191037/?project=6052513
- #1265
- #1185
- #1269

So, it turns out the reason we were getting these errors was because I
had not made the form picker smart enough to use the string value when a
delivery window was not present.

Now it is!

Also, reverting the StoreModel stuff because it did not seem to fix the
problem and I can't figure out why it's not working :'(
@zspencer
Copy link
Member

Fixed #1270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants