This file contains hidden or 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
| # models/material.rb | |
| class Material < ActiveRecord::Base | |
| has_many :products_materials | |
| has_many :products, :through => :products_materials | |
| validates :title, presence: true | |
| end | |
| # models/product.rb | |
| class Product < ActiveRecord::Base |
This file contains hidden or 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
| class Product < ActiveRecord::Base | |
| has_many :materials, :through => :product_materials | |
| has_many :products_material | |
| end | |
| class Material < ActiveRecord::Base | |
| belongs_to :product, :through => :products_material | |
| has_many :products_material | |
| end |
This file contains hidden or 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
| class Product < ActiveRecord::Base | |
| has_many :materials, :through => :products_materials | |
| end | |
| class Material < ActiveRecord::Base | |
| belongs_to :product, :through => :products_materials | |
| end | |
| class ProductsMaterials < ActiveRecord::Base | |
| belongs_to :product |
This file contains hidden or 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
| ActiveRecord::StatementInvalid in Spree::Admin::ProductsController#create | |
| SQLite3::SQLException: no such column: spree_visual_codes.type_id: SELECT "spree_visual_codes".* FROM "spree_visual_codes" WHERE "spree_visual_codes"."code" IS NULL AND "spree_visual_codes"."type_id" IN (SELECT "spree_visual_code_types"."id" FROM "spree_visual_code_types" WHERE "spree_visual_code_types"."name" = 'Barcode') | |
| Rails.root: /Users/phong/Sites/warehouse |
This file contains hidden or 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
| <p data-hook="visual_code"><%= f.label :visual_codes, t(:singular, :scope => :visual_code) %>: <br /> | |
| <%= f.text_field :visual_code %> | |
| </p> |
This file contains hidden or 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
| phong:~/custom_gems/doktorj/spree_warehouse[(cd45c27...)]$ bundle exec rake test_app | |
| Could not find gem 'rcov (>= 0) ruby' in any of the gem sources listed in your Gemfile. | |
| phong:~/custom_gems/doktorj/spree_warehouse[(cd45c27...)]$ rake test_app | |
| Generating dummy Rails application... | |
| rake aborted! | |
| Could not find gem 'rcov (>= 0) ruby' in any of the gem sources listed in your Gemfile. |
This file contains hidden or 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
| phong:~/custom_gems/doktorj/spree_warehouse[master]$ bundle exec rake test_app | |
| /Users/phong/custom_gems/doktorj/spree_warehouse/Gemfile:1:in `evaluate': undefined local variable or method `?' for #<Bundler::Dsl:0x0000010109be40> (NameError) | |
| from /Users/phong/.rvm/gems/ruby-1.9.3-p0@rails3.1.3/gems/bundler-1.0.21/lib/bundler/dsl.rb:7:in `instance_eval' | |
| from /Users/phong/.rvm/gems/ruby-1.9.3-p0@rails3.1.3/gems/bundler-1.0.21/lib/bundler/dsl.rb:7:in `evaluate' | |
| from /Users/phong/.rvm/gems/ruby-1.9.3-p0@rails3.1.3/gems/bundler-1.0.21/lib/bundler/definition.rb:17:in `build' | |
| from /Users/phong/.rvm/gems/ruby-1.9.3-p0@rails3.1.3/gems/bundler-1.0.21/lib/bundler.rb:138:in `definition' | |
| from /Users/phong/.rvm/gems/ruby-1.9.3-p0@rails3.1.3/gems/bundler-1.0.21/lib/bundler.rb:126:in `load' | |
| from /Users/phong/.rvm/gems/ruby-1.9.3-p0@rails3.1.3/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup' | |
| from /Users/phong/.rvm/gems/ruby-1.9.3-p0@rails3.1.3/gems/bundler-1.0.21/lib/bundler/cli.rb:340:in `exec' | |
| from /Users/phong/.rvm |
This file contains hidden or 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
| Hi. | |
| does anyone see any syntax issues with this? @variants just prints out an empty array, even tho I have 2 product variants, with their count_on_hand fields set. Hoping it's something simple. | |
| product_ids = Spree::Product.all.map(&:id) | |
| product_ids.each do |id| | |
| product = Spree::Product.find_by_id(id); @variants = product.variants.all; | |
| end | |
| @variants.map(&:count_on_hand) | |
| Thanx! |
This file contains hidden or 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
| Deface::Override.new(:virtual_path => "spree/layouts/admin/products", | |
| :name => "spree_warehouse_add_visual_codes_to_edit_product_sidebar", | |
| :insert_bottom => "[data-hook='admin_product_tabs']", | |
| :text => "Visual Codes") |
This file contains hidden or 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 | |
| class Role < ActiveRecord::Base | |
| has_and_belongs_to_many :users, :join_table => 'spree_roles_users' | |
| end | |
| end |