Add literally all the annotation

This commit is contained in:
tl3ilaxu 2016-03-08 15:53:50 +01:00
parent 87a383bfd2
commit 33184af8b3
17 changed files with 168 additions and 30 deletions

View file

@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: barcodes
#
# id :integer not null, primary key
# product_id :integer
# code :string default(""), not null
# created_at :datetime
# updated_at :datetime
#
class BarcodesController < ApplicationController class BarcodesController < ApplicationController
load_and_authorize_resource :product, only: :create load_and_authorize_resource :product, only: :create
load_and_authorize_resource :barcode, through: :product, shallow: true load_and_authorize_resource :barcode, through: :product, shallow: true

View file

@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: orders
#
# id :integer not null, primary key
# user_id :integer
# price_cents :integer
# created_at :datetime not null
# updated_at :datetime not null
# transaction_id :integer
#
class OrdersController < ApplicationController class OrdersController < ApplicationController
load_resource :user load_resource :user
load_and_authorize_resource :order, through: :user, shallow: true, only: [:overview, :destroy] load_and_authorize_resource :order, through: :user, shallow: true, only: [:overview, :destroy]

View file

@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: products
#
# id :integer not null, primary key
# name :string not null
# price_cents :integer default(0), not null
# created_at :datetime
# updated_at :datetime
# avatar_file_name :string
# avatar_content_type :string
# avatar_file_size :integer
# avatar_updated_at :datetime
# category :integer default(0)
# stock :integer default(0), not null
# calories :integer
# deleted :boolean default(FALSE)
#
class ProductsController < ApplicationController class ProductsController < ApplicationController
load_and_authorize_resource load_and_authorize_resource

View file

@ -1,3 +1,25 @@
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# created_at :datetime
# updated_at :datetime
# remember_created_at :datetime
# admin :boolean default(FALSE)
# dagschotel_id :integer
# avatar_file_name :string
# avatar_content_type :string
# avatar_file_size :integer
# avatar_updated_at :datetime
# orders_count :integer default(0)
# koelkast :boolean default(FALSE)
# name :string
# private :boolean default(FALSE)
# frecency :integer default(0), not null
# quickpay_hidden :boolean
#
class UsersController < ApplicationController class UsersController < ApplicationController
load_and_authorize_resource load_and_authorize_resource
before_action :init, only: :show before_action :init, only: :show

View file

@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: products
#
# id :integer not null, primary key
# name :string not null
# price_cents :integer default(0), not null
# created_at :datetime
# updated_at :datetime
# avatar_file_name :string
# avatar_content_type :string
# avatar_file_size :integer
# avatar_updated_at :datetime
# category :integer default(0)
# stock :integer default(0), not null
# calories :integer
# deleted :boolean default(FALSE)
#
module ProductsHelper module ProductsHelper
def kcal(calories) def kcal(calories)
calories.to_s + " kcal" calories.to_s + " kcal"

View file

@ -5,7 +5,7 @@
# id :integer not null, primary key # id :integer not null, primary key
# order_id :integer # order_id :integer
# product_id :integer not null # product_id :integer not null
# count :integer default("0") # count :integer default(0)
# #
class OrderItem < ActiveRecord::Base class OrderItem < ActiveRecord::Base

View file

@ -4,17 +4,17 @@
# #
# id :integer not null, primary key # id :integer not null, primary key
# name :string not null # name :string not null
# price_cents :integer default("0"), not null # price_cents :integer default(0), not null
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# avatar_file_name :string # avatar_file_name :string
# avatar_content_type :string # avatar_content_type :string
# avatar_file_size :integer # avatar_file_size :integer
# avatar_updated_at :datetime # avatar_updated_at :datetime
# category :integer default("0") # category :integer default(0)
# stock :integer default("0"), not null # stock :integer default(0), not null
# calories :integer # calories :integer
# deleted :boolean default("f") # deleted :boolean default(FALSE)
# #
class Product < ActiveRecord::Base class Product < ActiveRecord::Base

View file

@ -6,17 +6,18 @@
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# remember_created_at :datetime # remember_created_at :datetime
# admin :boolean # admin :boolean default(FALSE)
# dagschotel_id :integer # dagschotel_id :integer
# avatar_file_name :string # avatar_file_name :string
# avatar_content_type :string # avatar_content_type :string
# avatar_file_size :integer # avatar_file_size :integer
# avatar_updated_at :datetime # avatar_updated_at :datetime
# orders_count :integer default("0") # orders_count :integer default(0)
# koelkast :boolean default("f") # koelkast :boolean default(FALSE)
# name :string # name :string
# encrypted_password :string default(""), not null # private :boolean default(FALSE)
# private :boolean default("f") # frecency :integer default(0), not null
# quickpay_hidden :boolean
# #
class User < ActiveRecord::Base class User < ActiveRecord::Base

View file

@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: barcodes
#
# id :integer not null, primary key
# product_id :integer
# code :string default(""), not null
# created_at :datetime
# updated_at :datetime
#
# product_barcodes POST /products/:product_id/barcodes(.:format) barcodes#create # product_barcodes POST /products/:product_id/barcodes(.:format) barcodes#create
# barcodes GET /barcodes(.:format) barcodes#index # barcodes GET /barcodes(.:format) barcodes#index
# barcode GET /barcodes/:id(.:format) barcodes#show # barcode GET /barcodes/:id(.:format) barcodes#show

View file

@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: products
#
# id :integer not null, primary key
# name :string not null
# price_cents :integer default(0), not null
# created_at :datetime
# updated_at :datetime
# avatar_file_name :string
# avatar_content_type :string
# avatar_file_size :integer
# avatar_updated_at :datetime
# category :integer default(0)
# stock :integer default(0), not null
# calories :integer
# deleted :boolean default(FALSE)
#
# barcode_products GET /products/barcode(.:format) products#barcode # barcode_products GET /products/barcode(.:format) products#barcode
# load_barcode_products POST /products/barcode(.:format) products#load_barcode # load_barcode_products POST /products/barcode(.:format) products#load_barcode
# products GET /products(.:format) products#index # products GET /products(.:format) products#index

View file

@ -1,3 +1,25 @@
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# created_at :datetime
# updated_at :datetime
# remember_created_at :datetime
# admin :boolean default(FALSE)
# dagschotel_id :integer
# avatar_file_name :string
# avatar_content_type :string
# avatar_file_size :integer
# avatar_updated_at :datetime
# orders_count :integer default(0)
# koelkast :boolean default(FALSE)
# name :string
# private :boolean default(FALSE)
# frecency :integer default(0), not null
# quickpay_hidden :boolean
#
# quickpay_user GET /users/:id/quickpay(.:format) users#quickpay # quickpay_user GET /users/:id/quickpay(.:format) users#quickpay
# edit_dagschotel_user GET /users/:id/dagschotel/edit(.:format) users#edit_dagschotel # edit_dagschotel_user GET /users/:id/dagschotel/edit(.:format) users#edit_dagschotel
# edit_user GET /users/:id/edit(.:format) users#edit # edit_user GET /users/:id/edit(.:format) users#edit

View file

@ -5,7 +5,7 @@
# id :integer not null, primary key # id :integer not null, primary key
# order_id :integer # order_id :integer
# product_id :integer not null # product_id :integer not null
# count :integer default("0") # count :integer default(0)
# #
FactoryGirl.define do FactoryGirl.define do

View file

@ -4,17 +4,17 @@
# #
# id :integer not null, primary key # id :integer not null, primary key
# name :string not null # name :string not null
# price_cents :integer default("0"), not null # price_cents :integer default(0), not null
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# avatar_file_name :string # avatar_file_name :string
# avatar_content_type :string # avatar_content_type :string
# avatar_file_size :integer # avatar_file_size :integer
# avatar_updated_at :datetime # avatar_updated_at :datetime
# category :integer default("0") # category :integer default(0)
# stock :integer default("0"), not null # stock :integer default(0), not null
# calories :integer # calories :integer
# deleted :boolean default("f") # deleted :boolean default(FALSE)
# #
require 'faker' require 'faker'

View file

@ -6,17 +6,18 @@
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# remember_created_at :datetime # remember_created_at :datetime
# admin :boolean # admin :boolean default(FALSE)
# dagschotel_id :integer # dagschotel_id :integer
# avatar_file_name :string # avatar_file_name :string
# avatar_content_type :string # avatar_content_type :string
# avatar_file_size :integer # avatar_file_size :integer
# avatar_updated_at :datetime # avatar_updated_at :datetime
# orders_count :integer default("0") # orders_count :integer default(0)
# koelkast :boolean default("f") # koelkast :boolean default(FALSE)
# name :string # name :string
# encrypted_password :string default(""), not null # private :boolean default(FALSE)
# private :boolean default("f") # frecency :integer default(0), not null
# quickpay_hidden :boolean
# #
require 'faker' require 'faker'

View file

@ -5,7 +5,7 @@
# id :integer not null, primary key # id :integer not null, primary key
# order_id :integer # order_id :integer
# product_id :integer not null # product_id :integer not null
# count :integer default("0") # count :integer default(0)
# #
describe OrderItem do describe OrderItem do

View file

@ -4,17 +4,17 @@
# #
# id :integer not null, primary key # id :integer not null, primary key
# name :string not null # name :string not null
# price_cents :integer default("0"), not null # price_cents :integer default(0), not null
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# avatar_file_name :string # avatar_file_name :string
# avatar_content_type :string # avatar_content_type :string
# avatar_file_size :integer # avatar_file_size :integer
# avatar_updated_at :datetime # avatar_updated_at :datetime
# category :integer default("0") # category :integer default(0)
# stock :integer default("0"), not null # stock :integer default(0), not null
# calories :integer # calories :integer
# deleted :boolean default("f") # deleted :boolean default(FALSE)
# #
describe Product do describe Product do

View file

@ -6,17 +6,18 @@
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# remember_created_at :datetime # remember_created_at :datetime
# admin :boolean # admin :boolean default(FALSE)
# dagschotel_id :integer # dagschotel_id :integer
# avatar_file_name :string # avatar_file_name :string
# avatar_content_type :string # avatar_content_type :string
# avatar_file_size :integer # avatar_file_size :integer
# avatar_updated_at :datetime # avatar_updated_at :datetime
# orders_count :integer default("0") # orders_count :integer default(0)
# koelkast :boolean default("f") # koelkast :boolean default(FALSE)
# name :string # name :string
# encrypted_password :string default(""), not null # private :boolean default(FALSE)
# private :boolean default("f") # frecency :integer default(0), not null
# quickpay_hidden :boolean
# #
require 'webmock/rspec' require 'webmock/rspec'