-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
With oj gem - ActionView::Template::Error Infinity not allowed in JSON #2486
Labels
type:bug
Error, flaw or fault
Comments
I wasn't able to reproduce this, maybe I missed something. I added a spec to the orders_controller (which renders the same partials and is easier to test), and it rendered without error. |
Hmm - will take a closer look a bit later, but perhaps it's because we're
using OJ
gem 'oj', '~> 3.3.5'
…On Mon, Jan 8, 2018 at 5:40 PM John Hawthorn ***@***.***> wrote:
I wasn't able to reproduce this, maybe I missed something.
I added a spec to the orders_controller (which renders the same partials
and is easier to test), and it rendered without error.
***@***.***
<jhawthorn@5ae69a7>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2486 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACu4_MYIB17ftX7n9KITE1Ya-10bN14Gks5tIplpgaJpZM4RTXJZ>
.
|
Yep! oj seems to be the culprit |
jhawthorn
changed the title
Checkouts API should not attempt to serialize
With oj gem - ActionView::Template::Error Infinity not allowed in JSON
Jan 10, 2018
Float::INFINITY
Anyone else stumbling into this error, the solution is to set the following in an initializer:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Load an order from the Solidus Checkouts API with a Line Item Variant with
track_inventory: false
, using the following responder:respond_with(@order, default_template: 'spree/api/orders/show', status: 200)
Actual behavior
The API will throw:
ActionView::Template::Error Infinity not allowed in JSON.
Source of the issue:
solidus/api/app/views/spree/api/variants/_small.json.jbuilder
Line 8 in 96b30d6
As it corresponds to:
solidus/core/app/models/spree/stock/quantifier.rb
Line 26 in fb70a41
Expected behavior
I would expect that in the case
track_inventory
is false, the_small.json.jbuilder
template would not include thetotal_on_hand
attribute.System configuration
Solidus Version: 2.4.2
The text was updated successfully, but these errors were encountered: