New annotation, because of db switch to mysql.
Background: sqlite has some problems with decimal option.
This commit is contained in:
parent
c2496aa4fd
commit
46450cebef
60 changed files with 623 additions and 568 deletions
|
@ -1,12 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: article_categories
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# name :string(255) default(""), not null
|
|
||||||
# description :string(255)
|
|
||||||
#
|
|
||||||
|
|
||||||
class ArticleCategory < ActiveRecord::Base
|
class ArticleCategory < ActiveRecord::Base
|
||||||
has_many :articles
|
has_many :articles
|
||||||
|
|
||||||
|
@ -14,3 +5,13 @@ class ArticleCategory < ActiveRecord::Base
|
||||||
validates_uniqueness_of :name
|
validates_uniqueness_of :name
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: article_categories
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# name :string(255) default(""), not null
|
||||||
|
# description :string(255)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: article_prices
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# article_id :integer
|
|
||||||
# price :decimal(8, 2) default(0.0), not null
|
|
||||||
# tax :decimal(8, 2) default(0.0), not null
|
|
||||||
# deposit :decimal(8, 2) default(0.0), not null
|
|
||||||
# unit_quantity :integer
|
|
||||||
# created_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
class ArticlePrice < ActiveRecord::Base
|
class ArticlePrice < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :article
|
belongs_to :article
|
||||||
|
@ -43,3 +30,17 @@ class ArticlePrice < ActiveRecord::Base
|
||||||
(gross_price * (Foodsoft.config[:price_markup] / 100 + 1)).round(2)
|
(gross_price * (Foodsoft.config[:price_markup] / 100 + 1)).round(2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: article_prices
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# article_id :integer(4)
|
||||||
|
# price :decimal(8, 2) default(0.0), not null
|
||||||
|
# tax :decimal(8, 2) default(0.0), not null
|
||||||
|
# deposit :decimal(8, 2) default(0.0), not null
|
||||||
|
# unit_quantity :integer(4)
|
||||||
|
# created_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -14,13 +14,14 @@ class Assignment < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: assignments
|
# Table name: assignments
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# user_id :integer default(0), not null
|
# user_id :integer(4) default(0), not null
|
||||||
# task_id :integer default(0), not null
|
# task_id :integer(4) default(0), not null
|
||||||
# accepted :boolean default(FALSE)
|
# accepted :boolean(1) default(FALSE)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,13 @@ class Delivery < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: deliveries
|
# Table name: deliveries
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# supplier_id :integer
|
# supplier_id :integer(4)
|
||||||
# delivered_on :date
|
# delivered_on :date
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# note :text
|
# note :text
|
||||||
|
|
|
@ -1,15 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: financial_transactions
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# ordergroup_id :integer default(0), not null
|
|
||||||
# amount :decimal(8, 2) default(0.0), not null
|
|
||||||
# note :text not null
|
|
||||||
# user_id :integer default(0), not null
|
|
||||||
# created_on :datetime not null
|
|
||||||
#
|
|
||||||
|
|
||||||
# financial transactions are the foodcoop internal financial transactions
|
# financial transactions are the foodcoop internal financial transactions
|
||||||
# only ordergroups have an account balance and are happy to transfer money
|
# only ordergroups have an account balance and are happy to transfer money
|
||||||
class FinancialTransaction < ActiveRecord::Base
|
class FinancialTransaction < ActiveRecord::Base
|
||||||
|
@ -25,3 +13,16 @@ class FinancialTransaction < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: financial_transactions
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# ordergroup_id :integer(4) default(0), not null
|
||||||
|
# amount :decimal(8, 2) default(0.0), not null
|
||||||
|
# note :text default(""), not null
|
||||||
|
# user_id :integer(4) default(0), not null
|
||||||
|
# created_on :datetime not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -41,32 +41,33 @@ class Group < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: groups
|
# Table name: groups
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# type :string(255) default(""), not null
|
# type :string(255) default(""), not null
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# account_balance :decimal(, ) default(0.0), not null
|
# account_balance :decimal(8, 2) default(0.0), not null
|
||||||
# account_updated :datetime
|
# account_updated :datetime
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# role_admin :boolean default(FALSE), not null
|
# role_admin :boolean(1) default(FALSE), not null
|
||||||
# role_suppliers :boolean default(FALSE), not null
|
# role_suppliers :boolean(1) default(FALSE), not null
|
||||||
# role_article_meta :boolean default(FALSE), not null
|
# role_article_meta :boolean(1) default(FALSE), not null
|
||||||
# role_finance :boolean default(FALSE), not null
|
# role_finance :boolean(1) default(FALSE), not null
|
||||||
# role_orders :boolean default(FALSE), not null
|
# role_orders :boolean(1) default(FALSE), not null
|
||||||
# weekly_task :boolean default(FALSE)
|
# weekly_task :boolean(1) default(FALSE)
|
||||||
# weekday :integer
|
# weekday :integer(4)
|
||||||
# task_name :string(255)
|
# task_name :string(255)
|
||||||
# task_description :string(255)
|
# task_description :string(255)
|
||||||
# task_required_users :integer default(1)
|
# task_required_users :integer(4) default(1)
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# contact_person :string(255)
|
# contact_person :string(255)
|
||||||
# contact_phone :string(255)
|
# contact_phone :string(255)
|
||||||
# contact_address :string(255)
|
# contact_address :string(255)
|
||||||
# stats :text
|
# stats :text
|
||||||
# task_duration :integer default(1)
|
# task_duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: group_orders
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# ordergroup_id :integer default(0), not null
|
|
||||||
# order_id :integer default(0), not null
|
|
||||||
# price :decimal(8, 2) default(0.0), not null
|
|
||||||
# lock_version :integer default(0), not null
|
|
||||||
# updated_on :datetime not null
|
|
||||||
# updated_by_user_id :integer
|
|
||||||
#
|
|
||||||
|
|
||||||
# A GroupOrder represents an Order placed by an Ordergroup.
|
# A GroupOrder represents an Order placed by an Ordergroup.
|
||||||
class GroupOrder < ActiveRecord::Base
|
class GroupOrder < ActiveRecord::Base
|
||||||
|
|
||||||
|
@ -49,3 +36,17 @@ class GroupOrder < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: group_orders
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# ordergroup_id :integer(4) default(0), not null
|
||||||
|
# order_id :integer(4) default(0), not null
|
||||||
|
# price :decimal(8, 2) default(0.0), not null
|
||||||
|
# lock_version :integer(4) default(0), not null
|
||||||
|
# updated_on :datetime not null
|
||||||
|
# updated_by_user_id :integer(4)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -159,15 +159,16 @@ class GroupOrderArticle < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: group_order_articles
|
# Table name: group_order_articles
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# group_order_id :integer default(0), not null
|
# group_order_id :integer(4) default(0), not null
|
||||||
# order_article_id :integer default(0), not null
|
# order_article_id :integer(4) default(0), not null
|
||||||
# quantity :integer default(0), not null
|
# quantity :integer(4) default(0), not null
|
||||||
# tolerance :integer default(0), not null
|
# tolerance :integer(4) default(0), not null
|
||||||
# updated_on :datetime not null
|
# updated_on :datetime not null
|
||||||
# result :decimal(8, 3)
|
# result :decimal(8, 3)
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: group_order_article_quantities
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# group_order_article_id :integer default(0), not null
|
|
||||||
# quantity :integer default(0)
|
|
||||||
# tolerance :integer default(0)
|
|
||||||
# created_on :datetime not null
|
|
||||||
#
|
|
||||||
|
|
||||||
# stores the quantity, tolerance and timestamp of an GroupOrderArticle
|
# stores the quantity, tolerance and timestamp of an GroupOrderArticle
|
||||||
# Considers every update of an article-order, so may rows for one group_order_article ar possible.
|
# Considers every update of an article-order, so may rows for one group_order_article ar possible.
|
||||||
|
|
||||||
|
@ -21,3 +10,15 @@ class GroupOrderArticleQuantity < ActiveRecord::Base
|
||||||
validates_inclusion_of :tolerance, :in => 0..99
|
validates_inclusion_of :tolerance, :in => 0..99
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: group_order_article_quantities
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# group_order_article_id :integer(4) default(0), not null
|
||||||
|
# quantity :integer(4) default(0)
|
||||||
|
# tolerance :integer(4) default(0)
|
||||||
|
# created_on :datetime not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: invites
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# token :string(255) default(""), not null
|
|
||||||
# expires_at :datetime not null
|
|
||||||
# group_id :integer default(0), not null
|
|
||||||
# user_id :integer default(0), not null
|
|
||||||
# email :string(255) default(""), not null
|
|
||||||
#
|
|
||||||
|
|
||||||
require 'digest/sha1'
|
require 'digest/sha1'
|
||||||
|
|
||||||
# Invites are created by foodcoop users to invite a new user into the foodcoop and their order group.
|
# Invites are created by foodcoop users to invite a new user into the foodcoop and their order group.
|
||||||
|
@ -46,3 +34,16 @@ class Invite < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: invites
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# token :string(255) default(""), not null
|
||||||
|
# expires_at :datetime not null
|
||||||
|
# group_id :integer(4) default(0), not null
|
||||||
|
# user_id :integer(4) default(0), not null
|
||||||
|
# email :string(255) default(""), not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,15 @@ class Invoice < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: invoices
|
# Table name: invoices
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# supplier_id :integer
|
# supplier_id :integer(4)
|
||||||
# delivery_id :integer
|
# delivery_id :integer(4)
|
||||||
# order_id :integer
|
# order_id :integer(4)
|
||||||
# number :string(255)
|
# number :string(255)
|
||||||
# date :date
|
# date :date
|
||||||
# paid_on :date
|
# paid_on :date
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: memberships
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# group_id :integer default(0), not null
|
|
||||||
# user_id :integer default(0), not null
|
|
||||||
#
|
|
||||||
|
|
||||||
class Membership < ActiveRecord::Base
|
class Membership < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
@ -20,3 +11,13 @@ class Membership < ActiveRecord::Base
|
||||||
raise ERR_NO_ADMIN_MEMBER_DELETE if self.group.role_admin? && self.group.memberships.size == 1 && Group.find_all_by_role_admin(true).size == 1
|
raise ERR_NO_ADMIN_MEMBER_DELETE if self.group.role_admin? && self.group.memberships.size == 1 && Group.find_all_by_role_admin(true).size == 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: memberships
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# group_id :integer(4) default(0), not null
|
||||||
|
# user_id :integer(4) default(0), not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -76,17 +76,18 @@ class Message < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: messages
|
# Table name: messages
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# sender_id :integer
|
# sender_id :integer(4)
|
||||||
# recipients_ids :text
|
# recipients_ids :text
|
||||||
# subject :string(255) not null
|
# subject :string(255) not null
|
||||||
# body :text
|
# body :text
|
||||||
# email_state :integer default(0), not null
|
# email_state :integer(4) default(0), not null
|
||||||
# private :boolean default(FALSE)
|
# private :boolean(1) default(FALSE)
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: orders
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# supplier_id :integer
|
|
||||||
# note :text
|
|
||||||
# starts :datetime
|
|
||||||
# ends :datetime
|
|
||||||
# state :string(255) default("open")
|
|
||||||
# lock_version :integer default(0), not null
|
|
||||||
# updated_by_user_id :integer
|
|
||||||
# foodcoop_result :decimal(8, 2)
|
|
||||||
#
|
|
||||||
|
|
||||||
class Order < ActiveRecord::Base
|
class Order < ActiveRecord::Base
|
||||||
extend ActiveSupport::Memoizable # Ability to cache method results. Use memoize :expensive_method
|
extend ActiveSupport::Memoizable # Ability to cache method results. Use memoize :expensive_method
|
||||||
acts_as_ordered :order => "ends" # easyier find of next or previous model
|
acts_as_ordered :order => "ends" # easyier find of next or previous model
|
||||||
|
@ -226,3 +211,19 @@ class Order < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: orders
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# supplier_id :integer(4)
|
||||||
|
# note :text
|
||||||
|
# starts :datetime
|
||||||
|
# ends :datetime
|
||||||
|
# state :string(255) default("open")
|
||||||
|
# lock_version :integer(4) default(0), not null
|
||||||
|
# updated_by_user_id :integer(4)
|
||||||
|
# foodcoop_result :decimal(8, 2)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: order_articles
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# order_id :integer default(0), not null
|
|
||||||
# article_id :integer default(0), not null
|
|
||||||
# quantity :integer default(0), not null
|
|
||||||
# tolerance :integer default(0), not null
|
|
||||||
# units_to_order :integer default(0), not null
|
|
||||||
# lock_version :integer default(0), not null
|
|
||||||
# article_price_id :integer
|
|
||||||
#
|
|
||||||
|
|
||||||
# An OrderArticle represents a single Article that is part of an Order.
|
# An OrderArticle represents a single Article that is part of an Order.
|
||||||
class OrderArticle < ActiveRecord::Base
|
class OrderArticle < ActiveRecord::Base
|
||||||
|
|
||||||
|
@ -120,3 +106,18 @@ class OrderArticle < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: order_articles
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# order_id :integer(4) default(0), not null
|
||||||
|
# article_id :integer(4) default(0), not null
|
||||||
|
# quantity :integer(4) default(0), not null
|
||||||
|
# tolerance :integer(4) default(0), not null
|
||||||
|
# units_to_order :integer(4) default(0), not null
|
||||||
|
# lock_version :integer(4) default(0), not null
|
||||||
|
# article_price_id :integer(4)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: order_comments
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# order_id :integer
|
|
||||||
# user_id :integer
|
|
||||||
# text :text
|
|
||||||
# created_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
class OrderComment < ActiveRecord::Base
|
class OrderComment < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :order
|
belongs_to :order
|
||||||
|
@ -16,3 +5,15 @@ class OrderComment < ActiveRecord::Base
|
||||||
|
|
||||||
validates_presence_of :order_id, :user_id, :text
|
validates_presence_of :order_id, :user_id, :text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: order_comments
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# order_id :integer(4)
|
||||||
|
# user_id :integer(4)
|
||||||
|
# text :text
|
||||||
|
# created_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -87,28 +87,28 @@ end
|
||||||
#
|
#
|
||||||
# Table name: groups
|
# Table name: groups
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# type :string(255) default(""), not null
|
# type :string(255) default(""), not null
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# account_balance :decimal(, ) default(0.0), not null
|
# account_balance :decimal(8, 2) default(0.0), not null
|
||||||
# account_updated :datetime
|
# account_updated :datetime
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# role_admin :boolean default(FALSE), not null
|
# role_admin :boolean(1) default(FALSE), not null
|
||||||
# role_suppliers :boolean default(FALSE), not null
|
# role_suppliers :boolean(1) default(FALSE), not null
|
||||||
# role_article_meta :boolean default(FALSE), not null
|
# role_article_meta :boolean(1) default(FALSE), not null
|
||||||
# role_finance :boolean default(FALSE), not null
|
# role_finance :boolean(1) default(FALSE), not null
|
||||||
# role_orders :boolean default(FALSE), not null
|
# role_orders :boolean(1) default(FALSE), not null
|
||||||
# weekly_task :boolean default(FALSE)
|
# weekly_task :boolean(1) default(FALSE)
|
||||||
# weekday :integer
|
# weekday :integer(4)
|
||||||
# task_name :string(255)
|
# task_name :string(255)
|
||||||
# task_description :string(255)
|
# task_description :string(255)
|
||||||
# task_required_users :integer default(1)
|
# task_required_users :integer(4) default(1)
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# contact_person :string(255)
|
# contact_person :string(255)
|
||||||
# contact_phone :string(255)
|
# contact_phone :string(255)
|
||||||
# contact_address :string(255)
|
# contact_address :string(255)
|
||||||
# stats :text
|
# stats :text
|
||||||
# task_duration :integer default(1)
|
# task_duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -56,14 +56,14 @@ end
|
||||||
#
|
#
|
||||||
# Table name: pages
|
# Table name: pages
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# title :string(255)
|
# title :string(255)
|
||||||
# body :text
|
# body :text
|
||||||
# permalink :string(255)
|
# permalink :string(255)
|
||||||
# lock_version :integer default(0)
|
# lock_version :integer(4) default(0)
|
||||||
# updated_by :integer
|
# updated_by :integer(4)
|
||||||
# redirect :integer
|
# redirect :integer(4)
|
||||||
# parent_id :integer
|
# parent_id :integer(4)
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# updated_at :datetime
|
# updated_at :datetime
|
||||||
#
|
#
|
||||||
|
|
|
@ -42,25 +42,25 @@ end
|
||||||
#
|
#
|
||||||
# Table name: articles
|
# Table name: articles
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# supplier_id :integer default(0), not null
|
# supplier_id :integer(4) default(0), not null
|
||||||
# article_category_id :integer default(0), not null
|
# article_category_id :integer(4) default(0), not null
|
||||||
# unit :string(255) default(""), not null
|
# unit :string(255) default(""), not null
|
||||||
# note :string(255)
|
# note :string(255)
|
||||||
# availability :boolean default(TRUE), not null
|
# availability :boolean(1) default(TRUE), not null
|
||||||
# manufacturer :string(255)
|
# manufacturer :string(255)
|
||||||
# origin :string(255)
|
# origin :string(255)
|
||||||
# shared_updated_on :datetime
|
# shared_updated_on :datetime
|
||||||
# price :decimal(8, 2)
|
# price :decimal(8, 2)
|
||||||
# tax :float
|
# tax :float
|
||||||
# deposit :decimal(8, 2) default(0.0)
|
# deposit :decimal(8, 2) default(0.0)
|
||||||
# unit_quantity :integer default(1), not null
|
# unit_quantity :integer(4) default(1), not null
|
||||||
# order_number :string(255)
|
# order_number :string(255)
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# updated_at :datetime
|
# updated_at :datetime
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# type :string(255)
|
# type :string(255)
|
||||||
# quantity :integer default(0)
|
# quantity :integer(4) default(0)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: stock_changes
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# delivery_id :integer
|
|
||||||
# order_id :integer
|
|
||||||
# stock_article_id :integer
|
|
||||||
# quantity :integer default(0)
|
|
||||||
# created_at :datetime
|
|
||||||
# stock_taking_id :integer
|
|
||||||
#
|
|
||||||
|
|
||||||
class StockChange < ActiveRecord::Base
|
class StockChange < ActiveRecord::Base
|
||||||
belongs_to :delivery
|
belongs_to :delivery
|
||||||
belongs_to :order
|
belongs_to :order
|
||||||
|
@ -28,3 +15,17 @@ class StockChange < ActiveRecord::Base
|
||||||
stock_article.update_quantity!
|
stock_article.update_quantity!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: stock_changes
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# delivery_id :integer(4)
|
||||||
|
# order_id :integer(4)
|
||||||
|
# stock_article_id :integer(4)
|
||||||
|
# quantity :integer(4) default(0)
|
||||||
|
# created_at :datetime
|
||||||
|
# stock_taking_id :integer(4)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: stock_takings
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# date :date
|
|
||||||
# note :text
|
|
||||||
# created_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
class StockTaking < ActiveRecord::Base
|
class StockTaking < ActiveRecord::Base
|
||||||
|
|
||||||
has_many :stock_changes, :dependent => :destroy
|
has_many :stock_changes, :dependent => :destroy
|
||||||
|
@ -21,3 +11,14 @@ class StockTaking < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: stock_takings
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# date :date
|
||||||
|
# note :text
|
||||||
|
# created_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: suppliers
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# name :string(255) default(""), not null
|
|
||||||
# address :string(255) default(""), not null
|
|
||||||
# phone :string(255) default(""), not null
|
|
||||||
# phone2 :string(255)
|
|
||||||
# fax :string(255)
|
|
||||||
# email :string(255)
|
|
||||||
# url :string(255)
|
|
||||||
# contact_person :string(255)
|
|
||||||
# customer_number :string(255)
|
|
||||||
# delivery_days :string(255)
|
|
||||||
# order_howto :string(255)
|
|
||||||
# note :string(255)
|
|
||||||
# shared_supplier_id :integer
|
|
||||||
# min_order_quantity :string(255)
|
|
||||||
# deleted_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
class Supplier < ActiveRecord::Base
|
class Supplier < ActiveRecord::Base
|
||||||
acts_as_paranoid # Avoid deleting the supplier for consistency of order-results
|
acts_as_paranoid # Avoid deleting the supplier for consistency of order-results
|
||||||
|
|
||||||
|
@ -84,3 +62,26 @@ class Supplier < ActiveRecord::Base
|
||||||
return [updated_articles, outlisted_articles]
|
return [updated_articles, outlisted_articles]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: suppliers
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# name :string(255) default(""), not null
|
||||||
|
# address :string(255) default(""), not null
|
||||||
|
# phone :string(255) default(""), not null
|
||||||
|
# phone2 :string(255)
|
||||||
|
# fax :string(255)
|
||||||
|
# email :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# contact_person :string(255)
|
||||||
|
# customer_number :string(255)
|
||||||
|
# delivery_days :string(255)
|
||||||
|
# order_howto :string(255)
|
||||||
|
# note :string(255)
|
||||||
|
# shared_supplier_id :integer(4)
|
||||||
|
# min_order_quantity :string(255)
|
||||||
|
# deleted_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -77,17 +77,17 @@ end
|
||||||
#
|
#
|
||||||
# Table name: tasks
|
# Table name: tasks
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# due_date :date
|
# due_date :date
|
||||||
# done :boolean default(FALSE)
|
# done :boolean(1) default(FALSE)
|
||||||
# workgroup_id :integer
|
# workgroup_id :integer(4)
|
||||||
# assigned :boolean default(FALSE)
|
# assigned :boolean(1) default(FALSE)
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# updated_on :datetime not null
|
# updated_on :datetime not null
|
||||||
# required_users :integer default(1)
|
# required_users :integer(4) default(1)
|
||||||
# weekly :boolean
|
# weekly :boolean(1)
|
||||||
# duration :integer default(1)
|
# duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: users
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# nick :string(255) default(""), not null
|
|
||||||
# password_hash :string(255) default(""), not null
|
|
||||||
# password_salt :string(255) default(""), not null
|
|
||||||
# first_name :string(255) default(""), not null
|
|
||||||
# last_name :string(255) default(""), not null
|
|
||||||
# email :string(255) default(""), not null
|
|
||||||
# phone :string(255)
|
|
||||||
# created_on :datetime not null
|
|
||||||
# reset_password_token :string(255)
|
|
||||||
# reset_password_expires :datetime
|
|
||||||
# last_login :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
require 'digest/sha1'
|
require 'digest/sha1'
|
||||||
# specific user rights through memberships (see Group)
|
# specific user rights through memberships (see Group)
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
|
@ -195,3 +177,22 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: users
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# nick :string(255) default(""), not null
|
||||||
|
# password_hash :string(255) default(""), not null
|
||||||
|
# password_salt :string(255) default(""), not null
|
||||||
|
# first_name :string(255) default(""), not null
|
||||||
|
# last_name :string(255) default(""), not null
|
||||||
|
# email :string(255) default(""), not null
|
||||||
|
# phone :string(255)
|
||||||
|
# created_on :datetime not null
|
||||||
|
# reset_password_token :string(255)
|
||||||
|
# reset_password_expires :datetime
|
||||||
|
# last_login :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -49,28 +49,28 @@ end
|
||||||
#
|
#
|
||||||
# Table name: groups
|
# Table name: groups
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# type :string(255) default(""), not null
|
# type :string(255) default(""), not null
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# account_balance :decimal(, ) default(0.0), not null
|
# account_balance :decimal(8, 2) default(0.0), not null
|
||||||
# account_updated :datetime
|
# account_updated :datetime
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# role_admin :boolean default(FALSE), not null
|
# role_admin :boolean(1) default(FALSE), not null
|
||||||
# role_suppliers :boolean default(FALSE), not null
|
# role_suppliers :boolean(1) default(FALSE), not null
|
||||||
# role_article_meta :boolean default(FALSE), not null
|
# role_article_meta :boolean(1) default(FALSE), not null
|
||||||
# role_finance :boolean default(FALSE), not null
|
# role_finance :boolean(1) default(FALSE), not null
|
||||||
# role_orders :boolean default(FALSE), not null
|
# role_orders :boolean(1) default(FALSE), not null
|
||||||
# weekly_task :boolean default(FALSE)
|
# weekly_task :boolean(1) default(FALSE)
|
||||||
# weekday :integer
|
# weekday :integer(4)
|
||||||
# task_name :string(255)
|
# task_name :string(255)
|
||||||
# task_description :string(255)
|
# task_description :string(255)
|
||||||
# task_required_users :integer default(1)
|
# task_required_users :integer(4) default(1)
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# contact_person :string(255)
|
# contact_person :string(255)
|
||||||
# contact_phone :string(255)
|
# contact_phone :string(255)
|
||||||
# contact_address :string(255)
|
# contact_address :string(255)
|
||||||
# stats :text
|
# stats :text
|
||||||
# task_duration :integer default(1)
|
# task_duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
24
db/schema.rb
24
db/schema.rb
|
@ -129,28 +129,28 @@ ActiveRecord::Schema.define(:version => 20110507192928) do
|
||||||
add_index "group_orders", ["ordergroup_id"], :name => "index_group_orders_on_ordergroup_id"
|
add_index "group_orders", ["ordergroup_id"], :name => "index_group_orders_on_ordergroup_id"
|
||||||
|
|
||||||
create_table "groups", :force => true do |t|
|
create_table "groups", :force => true do |t|
|
||||||
t.string "type", :default => "", :null => false
|
t.string "type", :default => "", :null => false
|
||||||
t.string "name", :default => "", :null => false
|
t.string "name", :default => "", :null => false
|
||||||
t.string "description"
|
t.string "description"
|
||||||
t.decimal "account_balance", :default => 0.0, :null => false
|
t.decimal "account_balance", :precision => 8, :scale => 2, :default => 0.0, :null => false
|
||||||
t.datetime "account_updated"
|
t.datetime "account_updated"
|
||||||
t.datetime "created_on", :null => false
|
t.datetime "created_on", :null => false
|
||||||
t.boolean "role_admin", :default => false, :null => false
|
t.boolean "role_admin", :default => false, :null => false
|
||||||
t.boolean "role_suppliers", :default => false, :null => false
|
t.boolean "role_suppliers", :default => false, :null => false
|
||||||
t.boolean "role_article_meta", :default => false, :null => false
|
t.boolean "role_article_meta", :default => false, :null => false
|
||||||
t.boolean "role_finance", :default => false, :null => false
|
t.boolean "role_finance", :default => false, :null => false
|
||||||
t.boolean "role_orders", :default => false, :null => false
|
t.boolean "role_orders", :default => false, :null => false
|
||||||
t.boolean "weekly_task", :default => false
|
t.boolean "weekly_task", :default => false
|
||||||
t.integer "weekday"
|
t.integer "weekday"
|
||||||
t.string "task_name"
|
t.string "task_name"
|
||||||
t.string "task_description"
|
t.string "task_description"
|
||||||
t.integer "task_required_users", :default => 1
|
t.integer "task_required_users", :default => 1
|
||||||
t.datetime "deleted_at"
|
t.datetime "deleted_at"
|
||||||
t.string "contact_person"
|
t.string "contact_person"
|
||||||
t.string "contact_phone"
|
t.string "contact_phone"
|
||||||
t.string "contact_address"
|
t.string "contact_address"
|
||||||
t.text "stats"
|
t.text "stats"
|
||||||
t.integer "task_duration", :default => 1
|
t.integer "task_duration", :default => 1
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "groups", ["name"], :name => "index_groups_on_name", :unique => true
|
add_index "groups", ["name"], :name => "index_groups_on_name", :unique => true
|
||||||
|
|
19
test/fixtures/article_categories.yml
vendored
19
test/fixtures/article_categories.yml
vendored
|
@ -1,12 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: article_categories
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# name :string(255) default(""), not null
|
|
||||||
# description :string(255)
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
fruits:
|
fruits:
|
||||||
name: Fruits
|
name: Fruits
|
||||||
|
@ -15,3 +6,13 @@ vegi:
|
||||||
name: Vegetables
|
name: Vegetables
|
||||||
other:
|
other:
|
||||||
name: Other stuff
|
name: Other stuff
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: article_categories
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# name :string(255) default(""), not null
|
||||||
|
# description :string(255)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
27
test/fixtures/article_prices.yml
vendored
27
test/fixtures/article_prices.yml
vendored
|
@ -1,16 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: article_prices
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# article_id :integer
|
|
||||||
# price :decimal(8, 2) default(0.0), not null
|
|
||||||
# tax :decimal(8, 2) default(0.0), not null
|
|
||||||
# deposit :decimal(8, 2) default(0.0), not null
|
|
||||||
# unit_quantity :integer
|
|
||||||
# created_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
banana1:
|
banana1:
|
||||||
|
@ -48,3 +35,17 @@ applejuice1:
|
||||||
unit_quantity: 1
|
unit_quantity: 1
|
||||||
deposit: 0.15
|
deposit: 0.15
|
||||||
created_at: <%= Time.now.to_s(:db) %>
|
created_at: <%= Time.now.to_s(:db) %>
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: article_prices
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# article_id :integer(4)
|
||||||
|
# price :decimal(8, 2) default(0.0), not null
|
||||||
|
# tax :decimal(8, 2) default(0.0), not null
|
||||||
|
# deposit :decimal(8, 2) default(0.0), not null
|
||||||
|
# unit_quantity :integer(4)
|
||||||
|
# created_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
1
test/fixtures/articles.yml
vendored
1
test/fixtures/articles.yml
vendored
|
@ -80,6 +80,7 @@ applejuice:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: articles
|
# Table name: articles
|
||||||
|
|
9
test/fixtures/assignments.yml
vendored
9
test/fixtures/assignments.yml
vendored
|
@ -1,12 +1,13 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: assignments
|
# Table name: assignments
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# user_id :integer default(0), not null
|
# user_id :integer(4) default(0), not null
|
||||||
# task_id :integer default(0), not null
|
# task_id :integer(4) default(0), not null
|
||||||
# accepted :boolean default(FALSE)
|
# accepted :boolean(1) default(FALSE)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
25
test/fixtures/financial_transactions.yml
vendored
25
test/fixtures/financial_transactions.yml
vendored
|
@ -1,15 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: financial_transactions
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# ordergroup_id :integer default(0), not null
|
|
||||||
# amount :decimal(8, 2) default(0.0), not null
|
|
||||||
# note :text not null
|
|
||||||
# user_id :integer default(0), not null
|
|
||||||
# created_on :datetime not null
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
bananas1:
|
bananas1:
|
||||||
ordergroup: bananas
|
ordergroup: bananas
|
||||||
|
@ -23,3 +11,16 @@ bananas2:
|
||||||
amount: 100.00
|
amount: 100.00
|
||||||
note: Paying in from <%= 1.weeks.ago.strftime("%d.%m.%Y") %>
|
note: Paying in from <%= 1.weeks.ago.strftime("%d.%m.%Y") %>
|
||||||
created_on: <%= 1.weeks.ago.to_s(:db) %>
|
created_on: <%= 1.weeks.ago.to_s(:db) %>
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: financial_transactions
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# ordergroup_id :integer(4) default(0), not null
|
||||||
|
# amount :decimal(8, 2) default(0.0), not null
|
||||||
|
# note :text default(""), not null
|
||||||
|
# user_id :integer(4) default(0), not null
|
||||||
|
# created_on :datetime not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
13
test/fixtures/group_order_article_quantities.yml
vendored
13
test/fixtures/group_order_article_quantities.yml
vendored
|
@ -1,13 +1,14 @@
|
||||||
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: group_order_article_quantities
|
# Table name: group_order_article_quantities
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# group_order_article_id :integer default(0), not null
|
# group_order_article_id :integer(4) default(0), not null
|
||||||
# quantity :integer default(0)
|
# quantity :integer(4) default(0)
|
||||||
# tolerance :integer default(0)
|
# tolerance :integer(4) default(0)
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
#
|
#
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
|
|
23
test/fixtures/groups.yml
vendored
23
test/fixtures/groups.yml
vendored
|
@ -19,32 +19,33 @@ bananas:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: groups
|
# Table name: groups
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# type :string(255) default(""), not null
|
# type :string(255) default(""), not null
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# account_balance :decimal(, ) default(0.0), not null
|
# account_balance :decimal(8, 2) default(0.0), not null
|
||||||
# account_updated :datetime
|
# account_updated :datetime
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# role_admin :boolean default(FALSE), not null
|
# role_admin :boolean(1) default(FALSE), not null
|
||||||
# role_suppliers :boolean default(FALSE), not null
|
# role_suppliers :boolean(1) default(FALSE), not null
|
||||||
# role_article_meta :boolean default(FALSE), not null
|
# role_article_meta :boolean(1) default(FALSE), not null
|
||||||
# role_finance :boolean default(FALSE), not null
|
# role_finance :boolean(1) default(FALSE), not null
|
||||||
# role_orders :boolean default(FALSE), not null
|
# role_orders :boolean(1) default(FALSE), not null
|
||||||
# weekly_task :boolean default(FALSE)
|
# weekly_task :boolean(1) default(FALSE)
|
||||||
# weekday :integer
|
# weekday :integer(4)
|
||||||
# task_name :string(255)
|
# task_name :string(255)
|
||||||
# task_description :string(255)
|
# task_description :string(255)
|
||||||
# task_required_users :integer default(1)
|
# task_required_users :integer(4) default(1)
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# contact_person :string(255)
|
# contact_person :string(255)
|
||||||
# contact_phone :string(255)
|
# contact_phone :string(255)
|
||||||
# contact_address :string(255)
|
# contact_address :string(255)
|
||||||
# stats :text
|
# stats :text
|
||||||
# task_duration :integer default(1)
|
# task_duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
19
test/fixtures/memberships.yml
vendored
19
test/fixtures/memberships.yml
vendored
|
@ -1,12 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: memberships
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# group_id :integer default(0), not null
|
|
||||||
# user_id :integer default(0), not null
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
first:
|
first:
|
||||||
group: admins
|
group: admins
|
||||||
|
@ -15,3 +6,13 @@ second:
|
||||||
group: bananas
|
group: bananas
|
||||||
user: test
|
user: test
|
||||||
|
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: memberships
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# group_id :integer(4) default(0), not null
|
||||||
|
# user_id :integer(4) default(0), not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
9
test/fixtures/messages.yml
vendored
9
test/fixtures/messages.yml
vendored
|
@ -1,17 +1,18 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: messages
|
# Table name: messages
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# sender_id :integer
|
# sender_id :integer(4)
|
||||||
# recipients_ids :text
|
# recipients_ids :text
|
||||||
# subject :string(255) not null
|
# subject :string(255) not null
|
||||||
# body :text
|
# body :text
|
||||||
# email_state :integer default(0), not null
|
# email_state :integer(4) default(0), not null
|
||||||
# private :boolean default(FALSE)
|
# private :boolean(1) default(FALSE)
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
9
test/fixtures/order_comments.yml
vendored
9
test/fixtures/order_comments.yml
vendored
|
@ -1,12 +1,13 @@
|
||||||
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: order_comments
|
# Table name: order_comments
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# order_id :integer
|
# order_id :integer(4)
|
||||||
# user_id :integer
|
# user_id :integer(4)
|
||||||
# text :text
|
# text :text
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
#
|
#
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
11
test/fixtures/orders.yml
vendored
11
test/fixtures/orders.yml
vendored
|
@ -1,16 +1,17 @@
|
||||||
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: orders
|
# Table name: orders
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# supplier_id :integer
|
# supplier_id :integer(4)
|
||||||
# note :text
|
# note :text
|
||||||
# starts :datetime
|
# starts :datetime
|
||||||
# ends :datetime
|
# ends :datetime
|
||||||
# state :string(255) default("open")
|
# state :string(255) default("open")
|
||||||
# lock_version :integer default(0), not null
|
# lock_version :integer(4) default(0), not null
|
||||||
# updated_by_user_id :integer
|
# updated_by_user_id :integer(4)
|
||||||
# foodcoop_result :decimal(8, 2)
|
# foodcoop_result :decimal(8, 2)
|
||||||
#
|
#
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
11
test/fixtures/pages.yml
vendored
11
test/fixtures/pages.yml
vendored
|
@ -10,18 +10,19 @@ two:
|
||||||
body: MyText
|
body: MyText
|
||||||
permalink: MyString
|
permalink: MyString
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: pages
|
# Table name: pages
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# title :string(255)
|
# title :string(255)
|
||||||
# body :text
|
# body :text
|
||||||
# permalink :string(255)
|
# permalink :string(255)
|
||||||
# lock_version :integer default(0)
|
# lock_version :integer(4) default(0)
|
||||||
# updated_by :integer
|
# updated_by :integer(4)
|
||||||
# redirect :integer
|
# redirect :integer(4)
|
||||||
# parent_id :integer
|
# parent_id :integer(4)
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# updated_at :datetime
|
# updated_at :datetime
|
||||||
#
|
#
|
||||||
|
|
15
test/fixtures/stock_changes.yml
vendored
15
test/fixtures/stock_changes.yml
vendored
|
@ -1,14 +1,15 @@
|
||||||
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: stock_changes
|
# Table name: stock_changes
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# delivery_id :integer
|
# delivery_id :integer(4)
|
||||||
# order_id :integer
|
# order_id :integer(4)
|
||||||
# stock_article_id :integer
|
# stock_article_id :integer(4)
|
||||||
# quantity :integer default(0)
|
# quantity :integer(4) default(0)
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# stock_taking_id :integer
|
# stock_taking_id :integer(4)
|
||||||
#
|
#
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
7
test/fixtures/stock_takings.yml
vendored
7
test/fixtures/stock_takings.yml
vendored
|
@ -1,12 +1,13 @@
|
||||||
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: stock_takings
|
# Table name: stock_takings
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# date :date
|
# date :date
|
||||||
# note :text
|
# note :text
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
#
|
#
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
|
|
2
test/fixtures/suppliers.yml
vendored
2
test/fixtures/suppliers.yml
vendored
|
@ -45,6 +45,8 @@ terra:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: suppliers
|
# Table name: suppliers
|
||||||
|
|
15
test/fixtures/tasks.yml
vendored
15
test/fixtures/tasks.yml
vendored
|
@ -1,21 +1,22 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: tasks
|
# Table name: tasks
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# due_date :date
|
# due_date :date
|
||||||
# done :boolean default(FALSE)
|
# done :boolean(1) default(FALSE)
|
||||||
# workgroup_id :integer
|
# workgroup_id :integer(4)
|
||||||
# assigned :boolean default(FALSE)
|
# assigned :boolean(1) default(FALSE)
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# updated_on :datetime not null
|
# updated_on :datetime not null
|
||||||
# required_users :integer default(1)
|
# required_users :integer(4) default(1)
|
||||||
# weekly :boolean
|
# weekly :boolean(1)
|
||||||
# duration :integer default(1)
|
# duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
37
test/fixtures/users.yml
vendored
37
test/fixtures/users.yml
vendored
|
@ -1,21 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: users
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# nick :string(255) default(""), not null
|
|
||||||
# password_hash :string(255) default(""), not null
|
|
||||||
# password_salt :string(255) default(""), not null
|
|
||||||
# first_name :string(255) default(""), not null
|
|
||||||
# last_name :string(255) default(""), not null
|
|
||||||
# email :string(255) default(""), not null
|
|
||||||
# phone :string(255)
|
|
||||||
# created_on :datetime not null
|
|
||||||
# reset_password_token :string(255)
|
|
||||||
# reset_password_expires :datetime
|
|
||||||
# last_login :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||||
admin:
|
admin:
|
||||||
nick: admin
|
nick: admin
|
||||||
|
@ -33,3 +15,22 @@ test:
|
||||||
password_hash: 5549cd54032a72435037893b02d95ebef13cdc57
|
password_hash: 5549cd54032a72435037893b02d95ebef13cdc57
|
||||||
password_salt: DxnbIF1h
|
password_salt: DxnbIF1h
|
||||||
created_on: <%= Time.now.to_s(:db) %>
|
created_on: <%= Time.now.to_s(:db) %>
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: users
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# nick :string(255) default(""), not null
|
||||||
|
# password_hash :string(255) default(""), not null
|
||||||
|
# password_salt :string(255) default(""), not null
|
||||||
|
# first_name :string(255) default(""), not null
|
||||||
|
# last_name :string(255) default(""), not null
|
||||||
|
# email :string(255) default(""), not null
|
||||||
|
# phone :string(255)
|
||||||
|
# created_on :datetime not null
|
||||||
|
# reset_password_token :string(255)
|
||||||
|
# reset_password_expires :datetime
|
||||||
|
# last_login :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: article_categories
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# name :string(255) default(""), not null
|
|
||||||
# description :string(255)
|
|
||||||
#
|
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class ArticleCategoryTest < Test::Unit::TestCase
|
class ArticleCategoryTest < Test::Unit::TestCase
|
||||||
|
@ -17,3 +8,13 @@ class ArticleCategoryTest < Test::Unit::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: article_categories
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# name :string(255) default(""), not null
|
||||||
|
# description :string(255)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: article_prices
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# article_id :integer
|
|
||||||
# price :decimal(8, 2) default(0.0), not null
|
|
||||||
# tax :decimal(8, 2) default(0.0), not null
|
|
||||||
# deposit :decimal(8, 2) default(0.0), not null
|
|
||||||
# unit_quantity :integer
|
|
||||||
# created_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ArticlePriceTest < ActiveSupport::TestCase
|
class ArticlePriceTest < ActiveSupport::TestCase
|
||||||
|
@ -19,3 +6,17 @@ class ArticlePriceTest < ActiveSupport::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: article_prices
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# article_id :integer(4)
|
||||||
|
# price :decimal(8, 2) default(0.0), not null
|
||||||
|
# tax :decimal(8, 2) default(0.0), not null
|
||||||
|
# deposit :decimal(8, 2) default(0.0), not null
|
||||||
|
# unit_quantity :integer(4)
|
||||||
|
# created_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,14 @@ class AssignmentTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: assignments
|
# Table name: assignments
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# user_id :integer default(0), not null
|
# user_id :integer(4) default(0), not null
|
||||||
# task_id :integer default(0), not null
|
# task_id :integer(4) default(0), not null
|
||||||
# accepted :boolean default(FALSE)
|
# accepted :boolean(1) default(FALSE)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: financial_transactions
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# ordergroup_id :integer default(0), not null
|
|
||||||
# amount :decimal(8, 2) default(0.0), not null
|
|
||||||
# note :text not null
|
|
||||||
# user_id :integer default(0), not null
|
|
||||||
# created_on :datetime not null
|
|
||||||
#
|
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class FinancialTransactionTest < Test::Unit::TestCase
|
class FinancialTransactionTest < Test::Unit::TestCase
|
||||||
|
@ -20,3 +8,16 @@ class FinancialTransactionTest < Test::Unit::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: financial_transactions
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# ordergroup_id :integer(4) default(0), not null
|
||||||
|
# amount :decimal(8, 2) default(0.0), not null
|
||||||
|
# note :text default(""), not null
|
||||||
|
# user_id :integer(4) default(0), not null
|
||||||
|
# created_on :datetime not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: group_order_article_quantities
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# group_order_article_id :integer default(0), not null
|
|
||||||
# quantity :integer default(0)
|
|
||||||
# tolerance :integer default(0)
|
|
||||||
# created_on :datetime not null
|
|
||||||
#
|
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class GroupOrderArticleQuantityTest < Test::Unit::TestCase
|
class GroupOrderArticleQuantityTest < Test::Unit::TestCase
|
||||||
|
@ -19,3 +8,15 @@ class GroupOrderArticleQuantityTest < Test::Unit::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: group_order_article_quantities
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# group_order_article_id :integer(4) default(0), not null
|
||||||
|
# quantity :integer(4) default(0)
|
||||||
|
# tolerance :integer(4) default(0)
|
||||||
|
# created_on :datetime not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -11,32 +11,33 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: groups
|
# Table name: groups
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# type :string(255) default(""), not null
|
# type :string(255) default(""), not null
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# account_balance :decimal(, ) default(0.0), not null
|
# account_balance :decimal(8, 2) default(0.0), not null
|
||||||
# account_updated :datetime
|
# account_updated :datetime
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# role_admin :boolean default(FALSE), not null
|
# role_admin :boolean(1) default(FALSE), not null
|
||||||
# role_suppliers :boolean default(FALSE), not null
|
# role_suppliers :boolean(1) default(FALSE), not null
|
||||||
# role_article_meta :boolean default(FALSE), not null
|
# role_article_meta :boolean(1) default(FALSE), not null
|
||||||
# role_finance :boolean default(FALSE), not null
|
# role_finance :boolean(1) default(FALSE), not null
|
||||||
# role_orders :boolean default(FALSE), not null
|
# role_orders :boolean(1) default(FALSE), not null
|
||||||
# weekly_task :boolean default(FALSE)
|
# weekly_task :boolean(1) default(FALSE)
|
||||||
# weekday :integer
|
# weekday :integer(4)
|
||||||
# task_name :string(255)
|
# task_name :string(255)
|
||||||
# task_description :string(255)
|
# task_description :string(255)
|
||||||
# task_required_users :integer default(1)
|
# task_required_users :integer(4) default(1)
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# contact_person :string(255)
|
# contact_person :string(255)
|
||||||
# contact_phone :string(255)
|
# contact_phone :string(255)
|
||||||
# contact_address :string(255)
|
# contact_address :string(255)
|
||||||
# stats :text
|
# stats :text
|
||||||
# task_duration :integer default(1)
|
# task_duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: memberships
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# group_id :integer default(0), not null
|
|
||||||
# user_id :integer default(0), not null
|
|
||||||
#
|
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class MembershipTest < Test::Unit::TestCase
|
class MembershipTest < Test::Unit::TestCase
|
||||||
|
@ -17,3 +8,13 @@ class MembershipTest < Test::Unit::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: memberships
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# group_id :integer(4) default(0), not null
|
||||||
|
# user_id :integer(4) default(0), not null
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: order_comments
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# order_id :integer
|
|
||||||
# user_id :integer
|
|
||||||
# text :text
|
|
||||||
# created_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class OrderCommentTest < ActiveSupport::TestCase
|
class OrderCommentTest < ActiveSupport::TestCase
|
||||||
|
@ -17,3 +6,15 @@ class OrderCommentTest < ActiveSupport::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: order_comments
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# order_id :integer(4)
|
||||||
|
# user_id :integer(4)
|
||||||
|
# text :text
|
||||||
|
# created_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: orders
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# supplier_id :integer
|
|
||||||
# note :text
|
|
||||||
# starts :datetime
|
|
||||||
# ends :datetime
|
|
||||||
# state :string(255) default("open")
|
|
||||||
# lock_version :integer default(0), not null
|
|
||||||
# updated_by_user_id :integer
|
|
||||||
# foodcoop_result :decimal(8, 2)
|
|
||||||
#
|
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class OrderTest < Test::Unit::TestCase
|
class OrderTest < Test::Unit::TestCase
|
||||||
|
@ -23,3 +8,19 @@ class OrderTest < Test::Unit::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: orders
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# supplier_id :integer(4)
|
||||||
|
# note :text
|
||||||
|
# starts :datetime
|
||||||
|
# ends :datetime
|
||||||
|
# state :string(255) default("open")
|
||||||
|
# lock_version :integer(4) default(0), not null
|
||||||
|
# updated_by_user_id :integer(4)
|
||||||
|
# foodcoop_result :decimal(8, 2)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -7,18 +7,19 @@ class PageTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: pages
|
# Table name: pages
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# title :string(255)
|
# title :string(255)
|
||||||
# body :text
|
# body :text
|
||||||
# permalink :string(255)
|
# permalink :string(255)
|
||||||
# lock_version :integer default(0)
|
# lock_version :integer(4) default(0)
|
||||||
# updated_by :integer
|
# updated_by :integer(4)
|
||||||
# redirect :integer
|
# redirect :integer(4)
|
||||||
# parent_id :integer
|
# parent_id :integer(4)
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# updated_at :datetime
|
# updated_at :datetime
|
||||||
#
|
#
|
||||||
|
|
|
@ -7,29 +7,30 @@ class StockArticleTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: articles
|
# Table name: articles
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# supplier_id :integer default(0), not null
|
# supplier_id :integer(4) default(0), not null
|
||||||
# article_category_id :integer default(0), not null
|
# article_category_id :integer(4) default(0), not null
|
||||||
# unit :string(255) default(""), not null
|
# unit :string(255) default(""), not null
|
||||||
# note :string(255)
|
# note :string(255)
|
||||||
# availability :boolean default(TRUE), not null
|
# availability :boolean(1) default(TRUE), not null
|
||||||
# manufacturer :string(255)
|
# manufacturer :string(255)
|
||||||
# origin :string(255)
|
# origin :string(255)
|
||||||
# shared_updated_on :datetime
|
# shared_updated_on :datetime
|
||||||
# price :decimal(8, 2)
|
# price :decimal(8, 2)
|
||||||
# tax :float
|
# tax :float
|
||||||
# deposit :decimal(8, 2) default(0.0)
|
# deposit :decimal(8, 2) default(0.0)
|
||||||
# unit_quantity :integer default(1), not null
|
# unit_quantity :integer(4) default(1), not null
|
||||||
# order_number :string(255)
|
# order_number :string(255)
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# updated_at :datetime
|
# updated_at :datetime
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# type :string(255)
|
# type :string(255)
|
||||||
# quantity :integer default(0)
|
# quantity :integer(4) default(0)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: stock_changes
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# delivery_id :integer
|
|
||||||
# order_id :integer
|
|
||||||
# stock_article_id :integer
|
|
||||||
# quantity :integer default(0)
|
|
||||||
# created_at :datetime
|
|
||||||
# stock_taking_id :integer
|
|
||||||
#
|
|
||||||
|
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class StockChangeTest < ActiveSupport::TestCase
|
class StockChangeTest < ActiveSupport::TestCase
|
||||||
|
@ -19,3 +6,17 @@ class StockChangeTest < ActiveSupport::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: stock_changes
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# delivery_id :integer(4)
|
||||||
|
# order_id :integer(4)
|
||||||
|
# stock_article_id :integer(4)
|
||||||
|
# quantity :integer(4) default(0)
|
||||||
|
# created_at :datetime
|
||||||
|
# stock_taking_id :integer(4)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: stock_takings
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# date :date
|
|
||||||
# note :text
|
|
||||||
# created_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class StockTakingTest < ActiveSupport::TestCase
|
class StockTakingTest < ActiveSupport::TestCase
|
||||||
|
@ -16,3 +6,14 @@ class StockTakingTest < ActiveSupport::TestCase
|
||||||
assert true
|
assert true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: stock_takings
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# date :date
|
||||||
|
# note :text
|
||||||
|
# created_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: suppliers
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# name :string(255) default(""), not null
|
|
||||||
# address :string(255) default(""), not null
|
|
||||||
# phone :string(255) default(""), not null
|
|
||||||
# phone2 :string(255)
|
|
||||||
# fax :string(255)
|
|
||||||
# email :string(255)
|
|
||||||
# url :string(255)
|
|
||||||
# contact_person :string(255)
|
|
||||||
# customer_number :string(255)
|
|
||||||
# delivery_days :string(255)
|
|
||||||
# order_howto :string(255)
|
|
||||||
# note :string(255)
|
|
||||||
# shared_supplier_id :integer
|
|
||||||
# min_order_quantity :string(255)
|
|
||||||
# deleted_at :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class SupplierTest < Test::Unit::TestCase
|
class SupplierTest < Test::Unit::TestCase
|
||||||
|
@ -42,3 +20,26 @@ class SupplierTest < Test::Unit::TestCase
|
||||||
assert_equal 'wednesday', @supplier.delivery_days
|
assert_equal 'wednesday', @supplier.delivery_days
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: suppliers
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# name :string(255) default(""), not null
|
||||||
|
# address :string(255) default(""), not null
|
||||||
|
# phone :string(255) default(""), not null
|
||||||
|
# phone2 :string(255)
|
||||||
|
# fax :string(255)
|
||||||
|
# email :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# contact_person :string(255)
|
||||||
|
# customer_number :string(255)
|
||||||
|
# delivery_days :string(255)
|
||||||
|
# order_howto :string(255)
|
||||||
|
# note :string(255)
|
||||||
|
# shared_supplier_id :integer(4)
|
||||||
|
# min_order_quantity :string(255)
|
||||||
|
# deleted_at :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -10,21 +10,22 @@ class TaskTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: tasks
|
# Table name: tasks
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# due_date :date
|
# due_date :date
|
||||||
# done :boolean default(FALSE)
|
# done :boolean(1) default(FALSE)
|
||||||
# workgroup_id :integer
|
# workgroup_id :integer(4)
|
||||||
# assigned :boolean default(FALSE)
|
# assigned :boolean(1) default(FALSE)
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# updated_on :datetime not null
|
# updated_on :datetime not null
|
||||||
# required_users :integer default(1)
|
# required_users :integer(4) default(1)
|
||||||
# weekly :boolean
|
# weekly :boolean(1)
|
||||||
# duration :integer default(1)
|
# duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,3 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: users
|
|
||||||
#
|
|
||||||
# id :integer not null, primary key
|
|
||||||
# nick :string(255) default(""), not null
|
|
||||||
# password_hash :string(255) default(""), not null
|
|
||||||
# password_salt :string(255) default(""), not null
|
|
||||||
# first_name :string(255) default(""), not null
|
|
||||||
# last_name :string(255) default(""), not null
|
|
||||||
# email :string(255) default(""), not null
|
|
||||||
# phone :string(255)
|
|
||||||
# created_on :datetime not null
|
|
||||||
# reset_password_token :string(255)
|
|
||||||
# reset_password_expires :datetime
|
|
||||||
# last_login :datetime
|
|
||||||
#
|
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class UserTest < Test::Unit::TestCase
|
class UserTest < Test::Unit::TestCase
|
||||||
|
@ -49,3 +31,22 @@ class UserTest < Test::Unit::TestCase
|
||||||
assert_equal 'Passworteingaben stimmen nicht überein', @admin.errors.on_base
|
assert_equal 'Passworteingaben stimmen nicht überein', @admin.errors.on_base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: users
|
||||||
|
#
|
||||||
|
# id :integer(4) not null, primary key
|
||||||
|
# nick :string(255) default(""), not null
|
||||||
|
# password_hash :string(255) default(""), not null
|
||||||
|
# password_salt :string(255) default(""), not null
|
||||||
|
# first_name :string(255) default(""), not null
|
||||||
|
# last_name :string(255) default(""), not null
|
||||||
|
# email :string(255) default(""), not null
|
||||||
|
# phone :string(255)
|
||||||
|
# created_on :datetime not null
|
||||||
|
# reset_password_token :string(255)
|
||||||
|
# reset_password_expires :datetime
|
||||||
|
# last_login :datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
|
|
@ -9,32 +9,33 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: groups
|
# Table name: groups
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer(4) not null, primary key
|
||||||
# type :string(255) default(""), not null
|
# type :string(255) default(""), not null
|
||||||
# name :string(255) default(""), not null
|
# name :string(255) default(""), not null
|
||||||
# description :string(255)
|
# description :string(255)
|
||||||
# account_balance :decimal(, ) default(0.0), not null
|
# account_balance :decimal(8, 2) default(0.0), not null
|
||||||
# account_updated :datetime
|
# account_updated :datetime
|
||||||
# created_on :datetime not null
|
# created_on :datetime not null
|
||||||
# role_admin :boolean default(FALSE), not null
|
# role_admin :boolean(1) default(FALSE), not null
|
||||||
# role_suppliers :boolean default(FALSE), not null
|
# role_suppliers :boolean(1) default(FALSE), not null
|
||||||
# role_article_meta :boolean default(FALSE), not null
|
# role_article_meta :boolean(1) default(FALSE), not null
|
||||||
# role_finance :boolean default(FALSE), not null
|
# role_finance :boolean(1) default(FALSE), not null
|
||||||
# role_orders :boolean default(FALSE), not null
|
# role_orders :boolean(1) default(FALSE), not null
|
||||||
# weekly_task :boolean default(FALSE)
|
# weekly_task :boolean(1) default(FALSE)
|
||||||
# weekday :integer
|
# weekday :integer(4)
|
||||||
# task_name :string(255)
|
# task_name :string(255)
|
||||||
# task_description :string(255)
|
# task_description :string(255)
|
||||||
# task_required_users :integer default(1)
|
# task_required_users :integer(4) default(1)
|
||||||
# deleted_at :datetime
|
# deleted_at :datetime
|
||||||
# contact_person :string(255)
|
# contact_person :string(255)
|
||||||
# contact_phone :string(255)
|
# contact_phone :string(255)
|
||||||
# contact_address :string(255)
|
# contact_address :string(255)
|
||||||
# stats :text
|
# stats :text
|
||||||
# task_duration :integer default(1)
|
# task_duration :integer(4) default(1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue