From 442c6941229eb554d4f47d499c6cde3be4cde02a Mon Sep 17 00:00:00 2001 From: benji Date: Thu, 17 Sep 2015 15:32:39 +0200 Subject: [PATCH] Fix some small bugs --- Gemfile | 3 --- Gemfile.lock | 1 - app/models/product.rb | 2 +- app/views/layouts/_header.html.haml | 2 -- app/views/products_list/_product_edit_row.html.haml | 3 --- lib/tasks/devseeds.rake | 1 - 6 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index e4c6cc4..be43fd8 100644 --- a/Gemfile +++ b/Gemfile @@ -63,9 +63,6 @@ end # Airbrake gem 'airbrake' -# Debug stuff -gem 'byebug' - # Paginate stuff gem 'will_paginate', '3.0.7' gem 'bootstrap-will_paginate', '0.0.10' diff --git a/Gemfile.lock b/Gemfile.lock index 66cefc1..53a4869 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -332,7 +332,6 @@ DEPENDENCIES annotate bootstrap-sass (= 3.2.0.0) bootstrap-will_paginate (= 0.0.10) - byebug cancancan capistrano (~> 3.1) capistrano-passenger diff --git a/app/models/product.rb b/app/models/product.rb index d455f37..3f78e98 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -24,7 +24,7 @@ class Product < ActiveRecord::Base enum category: %w(food beverages other) validates :name, presence: true - validates :price_cents, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :price_cents, numericality: { only_integer: true, greater_than: 0 } validates :stock, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 } validates :calories, numericality: { only_integer: true, allow_nil: true, greater_than_or_equal_to: 0 } validates_attachment :avatar, diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 1c5ca21..04abf65 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -20,8 +20,6 @@ %li= mail_to "tab@zeus.ugent.be", "Send feedback" - if user_signed_in? - if can? :manage, :all - %li - = link_to "Place order", orders_path %li.dropdown %a.dropdown-toggle{"aria-expanded" => "false", "data-toggle" => "dropdown", href: "#", role: "button"} Products diff --git a/app/views/products_list/_product_edit_row.html.haml b/app/views/products_list/_product_edit_row.html.haml index 96535fc..2f9d368 100644 --- a/app/views/products_list/_product_edit_row.html.haml +++ b/app/views/products_list/_product_edit_row.html.haml @@ -14,8 +14,5 @@ $(id).parent().find('button').on('click', function(e) { e.preventDefault(); $(id).append(inputs.clone()); - $(id).append(' - %input{:name => "_method", :type => "hidden", :value => "patch"}>/ - '); $(id).submit(); }); diff --git a/lib/tasks/devseeds.rake b/lib/tasks/devseeds.rake index 221327f..3d6dbf8 100644 --- a/lib/tasks/devseeds.rake +++ b/lib/tasks/devseeds.rake @@ -1,7 +1,6 @@ unless Rails.env.production? require 'factory_girl' require 'faker' - Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f} task :sow => :environment do FactoryGirl.create_list(:user, 20) FactoryGirl.create_list(:product, 20)