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
| // stylesheets/partials/public/general.sass | |
| #flash | |
| border: solid 1px | |
| float: right | |
| font-size: 1.2em | |
| margin-right: 232px | |
| padding: 10px | |
| #flash.error |
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
| #in spec | |
| before :each do | |
| @supplier = Supplier.make | |
| stub(Supplier).find(1) { @supplier } | |
| stub(@supplier).save { true } | |
| @user_a = User.make | |
| @user_b = User.make | |
| stub(@supplier).users { [@user_a, @user_b] } | |
| 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 Manage::Products::SpecificationsController < ManageController | |
| # POST /manage/products/1/specifications | |
| #---------------------------------------------------------------------------- | |
| def create | |
| raise 'foo' | |
| # @product = Product.find(params[:product_id]) | |
| # @variant = @product.product_variants.find(params[:specification]["specable_id"]) | |
| # | |
| # # TODO - needs to be fixed, comes from formtastic in the new form |
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 (3.0.0) lib/active_record/associations/association_proxy.rb:260:in `raise_on_type_mismatch' | |
| activerecord (3.0.0) lib/active_record/associations/belongs_to_association.rb:23:in `replace' | |
| activerecord (3.0.0) lib/active_record/associations.rb:1474:in `specification_type=' | |
| activerecord (3.0.0) lib/active_record/base.rb:1548:in `send' | |
| activerecord (3.0.0) lib/active_record/base.rb:1548:in `attributes=' | |
| activerecord (3.0.0) lib/active_record/base.rb:1544:in `each' | |
| activerecord (3.0.0) lib/active_record/base.rb:1544:in `attributes=' | |
| cancan (1.4.1) lib/cancan/controller_resource.rb:72:in `build_resource' | |
| cancan (1.4.1) lib/cancan/controller_resource.rb:48:in `load_resource_instance' | |
| cancan (1.4.1) lib/cancan/controller_resource.rb:30:in `load_resource' |
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
| def merge_suppliers | |
| @supplier_from = Supplier.find(params[:id]) | |
| begin | |
| @supplier_to = Supplier.find(params[:supplier_id]) | |
| rescue ActiveRecord::RecordNotFound | |
| flash[:error] = "#{t('object.supplier')} #{t('messages.not_found')}" | |
| redirect_to manage_supplier_path(@supplier_from.id) | |
| 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
| def generate_breadcrumbs(current, breadcrumbs) | |
| if current.root? | |
| [current.id] | |
| elsif breadcrumbs.present? | |
| traverse_breadcrumbs(current, breadcrumbs) | |
| end | |
| end | |
| def traverse_breadcrumbs(current, breadcrumbs) |
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
| def index | |
| if request.format == 'json' | |
| if params[:product_type_id].present? | |
| @search_trees = ProductType.find(params[:product_type_id]).search_trees | |
| else | |
| @search_trees = SearchTree.botttom_nodes | |
| end | |
| else | |
| @search_trees = SearchTree.roots | |
| 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
| def index | |
| if request.format.json? | |
| if params[:product_type_id].present? | |
| @search_trees = ProductType.find(params[:product_type_id]).search_trees | |
| else | |
| @search_trees = SearchTree.bottom_nodes | |
| end | |
| else | |
| @search_trees = SearchTree.roots | |
| 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
| before :each do | |
| login_as_admin! | |
| end | |
| before :all do | |
| @search_tree_a = SearchTree.make! | |
| @search_tree_b = SearchTree.make! | |
| @search_tree_c = SearchTree.make! | |
| @product_type = ProductType.make! | |
| @search_tree_a.children << @search_tree_b |
OlderNewer