-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
RuntimeError in Spree/admin/products#index in production mode #2697
Comments
master being nil means your product is mis-configured. How was your product created? Nothing within Spree should have allowed you to create a product without a master variant. |
What Andrew said! :) Please provide steps to reproduce this issue. On 15/03/2013, at 4:51, Andrew Hooker notifications@github.com wrote:
|
Well I am trying to create products from console by this
Are there any commands or proper ways to create products from console ............. |
Why are you doing it this way, and not using Spree::Product.create()? You're missing the master variant, which is a definite Spree requirement.Andrew Hooker Register now for SpreeConf On Mar 14, 2013, at 10:10 PM, Harssh notifications@github.com wrote:
|
Ok I did this p = Spree::Product.create(name: 'tryproduct', price: 12) but it is not shown in store ........ |
You'll want to set all the values you were setting in your SQL query… available_on is the big one you're missing I think… and count_on_hand depending on your inventory settings.Andrew Hooker Register now for SpreeConf On Mar 14, 2013, at 10:10 PM, Harssh notifications@github.com wrote:
|
I don't think there's anything left to do on this issue now. Closing. |
Yep done thanx @radar and @GeekOnCoffee |
spree version 1.3.x
ruby 1.9.3
rails 3.2.12
RuntimeError in Spree/admin/products#index
Showing /usr/lib/ruby/gems/1.9.1/gems/spree_core-1.3.2/app/views/spree/admin/products/index.html.erb where line #83 raised:
Spree::Product#master_images delegated to master.images, but master is nil: #<Spree::Product id: 1060543640, name: "SampleProductABC", description: nil, available_on: "2012-03-13 05:01:14", deleted_at: nil, permalink: "SampleProductABC", meta_description: nil, meta_keywords: nil, tax_category_id: nil, shipping_category_id: nil, count_on_hand: 5, created_at: "2012-03-13 05:01:14", updated_at: "2012-03-13 05:01:14", on_demand: false>
Extracted source (around line #83):
80: <% @collection.each do |product| %>
81: <tr <%= "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows" class="<%= cycle('odd', 'even') %>">
82: <%= product.sku rescue '' %>
83: <%= mini_image(product) %>
84: <%= link_to product.try(:name), edit_admin_product_path(product) %>
85: <%= product.display_price rescue '' %>
86:
The text was updated successfully, but these errors were encountered: