This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(0.2ms) BEGIN | |
(0.8ms) SELECT COUNT(*) FROM "spree_products" WHERE ("spree_products".deleted_at IS NULL) AND (spree_products.permalink LIKE 'the-other-product%') | |
Spree::Product Load (0.8ms) SELECT "spree_products".* FROM "spree_products" WHERE ("spree_products".deleted_at IS NULL) AND (spree_products.permalink LIKE 'the-other-product%') | |
Spree::Product::Translation Load (0.4ms) SELECT "spree_product_translations".* FROM "spree_product_translations" WHERE "spree_product_translations"."spree_product_id" = $1 [["spree_product_id", 303]] | |
SQL (0.5ms) INSERT INTO "spree_products" ("created_at", "name", "permalink", "shipping_category_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 13 Jan 2014 16:29:00 UTC +00:00], ["name", "The Other Product"], ["permalink", "the-other-product-1"], ["shipping_category_id", 1], ["updated_at", Mon, 13 Jan 2014 16:29:00 UTC +00:00]] | |
SQL (0.4ms) INSERT INTO "spree_product_properties" ("created_at", "product_id", "property_id", "upd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Spree.version | |
=> "2.1.4.beta" | |
>> Spree::Config[:require_master_price] = true | |
>> attr = {:name=>"The Other Product", :price=>19.99, :shipping_category_id=>1, :product_properties_attributes=>[{:property_name=>"fabric", :value=>"cotton"}]} | |
>> pr = Spree::Product.new attr | |
>> pr.save! | |
RuntimeError: No master variant found to infer price |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Admin::ProductController.class_eval do | |
set_callback :load_collection, :after, :funky_filter | |
private | |
def funky_filter | |
@collection = @collection.where(name: 'peter') | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spree | |
module Admin | |
class ProductController < Spree::Admin::ResourceController | |
include ActiveSupport::Callbacks | |
define_callbacks :load_collection | |
set_callback :load_collection, :after, :paginate_collection | |
def index | |
respond_with(@collection) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').on('click', '.js-observe-me', function(){ | |
alert("Wow! Nice click!"); | |
}); |
NewerOlder