Fix some small bugs

This commit is contained in:
benji 2015-09-17 15:32:39 +02:00
parent ef75909298
commit 442c694122
6 changed files with 1 additions and 11 deletions

View file

@ -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'

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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();
});

View file

@ -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)