Here's my model:

#<Spree::Product id: 1,
name: "Prototypical Sculpture",
description: "", available_on: "2013-03-13 00:00:00",
deleted_at: nil,
permalink: "prototypical-sculpture",
meta_description: "",
meta_keywords: "",
tax_category_id: nil,
shipping_category_id: nil,
count_on_hand: 0,
created_at: "2013-03-13 13:29:22",
updated_at: "2013-03-13 13:48:19",
on_demand: false,
worthy_of_welcome_page: false>

When I run product.on_sale?, rails returns true although the product has a
count_on_hand of 0, and on_demand is set to false.

When I run this same command locally on what appears to be an identical
object, on_sale? properly returns false.

I'm not sure what would cause this difference in behavior, anybody able to
point me in the right direction?


--
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Jason Rylance at Mar 13, 2013 at 2:43 pm
    [SOLVED] I had failed to set Spree::Config[:allow_backorders] to false with
    an override, so when I deployed the app I was using the default value of
    true. I simply went into the config of Spree's admin panel and set Allow
    Backorders to false.
    On Wednesday, March 13, 2013 8:56:17 AM UTC-5, Jason Rylance wrote:

    Here's my model:

    #<Spree::Product id: 1,
    name: "Prototypical Sculpture",
    description: "", available_on: "2013-03-13 00:00:00",
    deleted_at: nil,
    permalink: "prototypical-sculpture",
    meta_description: "",
    meta_keywords: "",
    tax_category_id: nil,
    shipping_category_id: nil,
    count_on_hand: 0,
    created_at: "2013-03-13 13:29:22",
    updated_at: "2013-03-13 13:48:19",
    on_demand: false,
    worthy_of_welcome_page: false>

    When I run product.on_sale?, rails returns true although the product has
    a count_on_hand of 0, and on_demand is set to false.

    When I run this same command locally on what appears to be an identical
    object, on_sale? properly returns false.

    I'm not sure what would cause this difference in behavior, anybody able to
    point me in the right direction?

    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ryan Bigg at Mar 18, 2013 at 12:11 am
    Great to hear you managed to solve this yourself, Jason :)

    On Thu, Mar 14, 2013 at 1:43 AM, Jason Rylance wrote:

    [SOLVED] I had failed to set Spree::Config[:allow_backorders] to falsewith an override, so when I deployed the app I was using the default value
    of true. I simply went into the config of Spree's admin panel and set Allow
    Backorders to false.

    On Wednesday, March 13, 2013 8:56:17 AM UTC-5, Jason Rylance wrote:

    Here's my model:

    #<Spree::Product id: 1,
    name: "Prototypical Sculpture",
    description: "", available_on: "2013-03-13 00:00:00",
    deleted_at: nil,
    permalink: "prototypical-sculpture",
    meta_description: "",
    meta_keywords: "",
    tax_category_id: nil,
    shipping_category_id: nil,
    count_on_hand: 0,
    created_at: "2013-03-13 13:29:22",
    updated_at: "2013-03-13 13:48:19",
    on_demand: false,
    worthy_of_welcome_page: false>

    When I run product.on_sale?, rails returns true although the product has
    a count_on_hand of 0, and on_demand is set to false.

    When I run this same command locally on what appears to be an identical
    object, on_sale? properly returns false.

    I'm not sure what would cause this difference in behavior, anybody able
    to point me in the right direction?


    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --

    Ryan Bigg
    Community Manager
    Spree Commerce, Inc.

    Register now for SpreeConf
    May 20-21 in Washington, D.C.
    http://spreeconf.com

    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedMar 13, '13 at 1:56p
activeMar 18, '13 at 12:11a
posts3
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Jason Rylance: 2 posts Ryan Bigg: 1 post

People

Translate

site design / logo © 2022 Grokbase