Add literally all the annotation
This commit is contained in:
parent
87a383bfd2
commit
33184af8b3
17 changed files with 168 additions and 30 deletions
|
@ -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
|
||||
load_and_authorize_resource :product, only: :create
|
||||
load_and_authorize_resource :barcode, through: :product, shallow: true
|
||||
|
|
|
@ -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
|
||||
load_resource :user
|
||||
load_and_authorize_resource :order, through: :user, shallow: true, only: [:overview, :destroy]
|
||||
|
|
|
@ -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
|
||||
load_and_authorize_resource
|
||||
|
||||
|
|
|
@ -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
|
||||
load_and_authorize_resource
|
||||
before_action :init, only: :show
|
||||
|
|
|
@ -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
|
||||
def kcal(calories)
|
||||
calories.to_s + " kcal"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# id :integer not null, primary key
|
||||
# order_id :integer
|
||||
# product_id :integer not null
|
||||
# count :integer default("0")
|
||||
# count :integer default(0)
|
||||
#
|
||||
|
||||
class OrderItem < ActiveRecord::Base
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string not null
|
||||
# price_cents :integer default("0"), 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
|
||||
# category :integer default(0)
|
||||
# stock :integer default(0), not null
|
||||
# calories :integer
|
||||
# deleted :boolean default("f")
|
||||
# deleted :boolean default(FALSE)
|
||||
#
|
||||
|
||||
class Product < ActiveRecord::Base
|
||||
|
|
|
@ -6,17 +6,18 @@
|
|||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# remember_created_at :datetime
|
||||
# admin :boolean
|
||||
# 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("f")
|
||||
# orders_count :integer default(0)
|
||||
# koelkast :boolean default(FALSE)
|
||||
# name :string
|
||||
# encrypted_password :string default(""), not null
|
||||
# private :boolean default("f")
|
||||
# private :boolean default(FALSE)
|
||||
# frecency :integer default(0), not null
|
||||
# quickpay_hidden :boolean
|
||||
#
|
||||
|
||||
class User < ActiveRecord::Base
|
||||
|
|
|
@ -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
|
||||
# barcodes GET /barcodes(.:format) barcodes#index
|
||||
# barcode GET /barcodes/:id(.:format) barcodes#show
|
||||
|
|
|
@ -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
|
||||
# load_barcode_products POST /products/barcode(.:format) products#load_barcode
|
||||
# products GET /products(.:format) products#index
|
||||
|
|
|
@ -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
|
||||
# edit_dagschotel_user GET /users/:id/dagschotel/edit(.:format) users#edit_dagschotel
|
||||
# edit_user GET /users/:id/edit(.:format) users#edit
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# id :integer not null, primary key
|
||||
# order_id :integer
|
||||
# product_id :integer not null
|
||||
# count :integer default("0")
|
||||
# count :integer default(0)
|
||||
#
|
||||
|
||||
FactoryGirl.define do
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string not null
|
||||
# price_cents :integer default("0"), 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
|
||||
# category :integer default(0)
|
||||
# stock :integer default(0), not null
|
||||
# calories :integer
|
||||
# deleted :boolean default("f")
|
||||
# deleted :boolean default(FALSE)
|
||||
#
|
||||
|
||||
require 'faker'
|
||||
|
|
|
@ -6,17 +6,18 @@
|
|||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# remember_created_at :datetime
|
||||
# admin :boolean
|
||||
# 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("f")
|
||||
# orders_count :integer default(0)
|
||||
# koelkast :boolean default(FALSE)
|
||||
# name :string
|
||||
# encrypted_password :string default(""), not null
|
||||
# private :boolean default("f")
|
||||
# private :boolean default(FALSE)
|
||||
# frecency :integer default(0), not null
|
||||
# quickpay_hidden :boolean
|
||||
#
|
||||
|
||||
require 'faker'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# id :integer not null, primary key
|
||||
# order_id :integer
|
||||
# product_id :integer not null
|
||||
# count :integer default("0")
|
||||
# count :integer default(0)
|
||||
#
|
||||
|
||||
describe OrderItem do
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string not null
|
||||
# price_cents :integer default("0"), 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
|
||||
# category :integer default(0)
|
||||
# stock :integer default(0), not null
|
||||
# calories :integer
|
||||
# deleted :boolean default("f")
|
||||
# deleted :boolean default(FALSE)
|
||||
#
|
||||
|
||||
describe Product do
|
||||
|
|
|
@ -6,17 +6,18 @@
|
|||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# remember_created_at :datetime
|
||||
# admin :boolean
|
||||
# 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("f")
|
||||
# orders_count :integer default(0)
|
||||
# koelkast :boolean default(FALSE)
|
||||
# name :string
|
||||
# encrypted_password :string default(""), not null
|
||||
# private :boolean default("f")
|
||||
# private :boolean default(FALSE)
|
||||
# frecency :integer default(0), not null
|
||||
# quickpay_hidden :boolean
|
||||
#
|
||||
|
||||
require 'webmock/rspec'
|
||||
|
|
Loading…
Reference in a new issue