Fix some small bugs
This commit is contained in:
parent
ef75909298
commit
442c694122
3
Gemfile
3
Gemfile
|
@ -63,9 +63,6 @@ end
|
||||||
# Airbrake
|
# Airbrake
|
||||||
gem 'airbrake'
|
gem 'airbrake'
|
||||||
|
|
||||||
# Debug stuff
|
|
||||||
gem 'byebug'
|
|
||||||
|
|
||||||
# Paginate stuff
|
# Paginate stuff
|
||||||
gem 'will_paginate', '3.0.7'
|
gem 'will_paginate', '3.0.7'
|
||||||
gem 'bootstrap-will_paginate', '0.0.10'
|
gem 'bootstrap-will_paginate', '0.0.10'
|
||||||
|
|
|
@ -332,7 +332,6 @@ DEPENDENCIES
|
||||||
annotate
|
annotate
|
||||||
bootstrap-sass (= 3.2.0.0)
|
bootstrap-sass (= 3.2.0.0)
|
||||||
bootstrap-will_paginate (= 0.0.10)
|
bootstrap-will_paginate (= 0.0.10)
|
||||||
byebug
|
|
||||||
cancancan
|
cancancan
|
||||||
capistrano (~> 3.1)
|
capistrano (~> 3.1)
|
||||||
capistrano-passenger
|
capistrano-passenger
|
||||||
|
|
|
@ -24,7 +24,7 @@ class Product < ActiveRecord::Base
|
||||||
enum category: %w(food beverages other)
|
enum category: %w(food beverages other)
|
||||||
|
|
||||||
validates :name, presence: true
|
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 :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 :calories, numericality: { only_integer: true, allow_nil: true, greater_than_or_equal_to: 0 }
|
||||||
validates_attachment :avatar,
|
validates_attachment :avatar,
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
%li= mail_to "tab@zeus.ugent.be", "Send feedback"
|
%li= mail_to "tab@zeus.ugent.be", "Send feedback"
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
- if can? :manage, :all
|
- if can? :manage, :all
|
||||||
%li
|
|
||||||
= link_to "Place order", orders_path
|
|
||||||
%li.dropdown
|
%li.dropdown
|
||||||
%a.dropdown-toggle{"aria-expanded" => "false", "data-toggle" => "dropdown", href: "#", role: "button"}
|
%a.dropdown-toggle{"aria-expanded" => "false", "data-toggle" => "dropdown", href: "#", role: "button"}
|
||||||
Products
|
Products
|
||||||
|
|
|
@ -14,8 +14,5 @@
|
||||||
$(id).parent().find('button').on('click', function(e) {
|
$(id).parent().find('button').on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(id).append(inputs.clone());
|
$(id).append(inputs.clone());
|
||||||
$(id).append('
|
|
||||||
%input{:name => "_method", :type => "hidden", :value => "patch"}>/
|
|
||||||
');
|
|
||||||
$(id).submit();
|
$(id).submit();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
unless Rails.env.production?
|
unless Rails.env.production?
|
||||||
require 'factory_girl'
|
require 'factory_girl'
|
||||||
require 'faker'
|
require 'faker'
|
||||||
Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f}
|
|
||||||
task :sow => :environment do
|
task :sow => :environment do
|
||||||
FactoryGirl.create_list(:user, 20)
|
FactoryGirl.create_list(:user, 20)
|
||||||
FactoryGirl.create_list(:product, 20)
|
FactoryGirl.create_list(:product, 20)
|
||||||
|
|
Loading…
Reference in a new issue