Merge branch 'stats'

This commit is contained in:
Benjamin Meichsner 2009-08-02 19:57:19 +02:00
commit 6659fe90f3
65 changed files with 393 additions and 324 deletions

View file

@ -1,28 +1,27 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# 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(, ) # price :decimal(8, 2)
# tax :float # tax :float
# deposit :decimal(, ) 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
# quantity :integer default(0)
# deleted_at :datetime # deleted_at :datetime
# type :string(255) # type :string(255)
# quantity :integer(4) default(0)
# #
class Article < ActiveRecord::Base class Article < ActiveRecord::Base

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: article_categories # Table name: article_categories
# #
# 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)
# #

View file

@ -1,14 +1,13 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: article_prices # Table name: article_prices
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# article_id :integer # article_id :integer(4)
# price :decimal(8, 2) default(0.0), not null # price :decimal(8, 2) default(0.0), not null
# tax :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 # deposit :decimal(8, 2) default(0.0), not null
# unit_quantity :integer # unit_quantity :integer(4)
# created_at :datetime # created_at :datetime
# #

View file

@ -1,12 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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 # accepted :boolean(1)
# #
class Assignment < ActiveRecord::Base class Assignment < ActiveRecord::Base

View file

@ -1,10 +1,9 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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
# #

View file

@ -1,13 +1,12 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: financial_transactions # Table name: financial_transactions
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# ordergroup_id :integer default(0), not null # ordergroup_id :integer(4) default(0), not null
# amount :decimal(8, 2) default(0.0), not null # amount :decimal(8, 2) default(0.0), not null
# note :text not null # note :text default(""), not null
# user_id :integer default(0), not null # user_id :integer(4) default(0), not null
# created_on :datetime not null # created_on :datetime not null
# #

View file

@ -1,29 +1,29 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# 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 not null # role_admin :boolean(1) not null
# role_suppliers :boolean not null # role_suppliers :boolean(1) not null
# role_article_meta :boolean not null # role_article_meta :boolean(1) not null
# role_finance :boolean not null # role_finance :boolean(1) not null
# role_orders :boolean not null # role_orders :boolean(1) not null
# weekly_task :boolean # weekly_task :boolean(1)
# 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
# #
# Groups organize the User. # Groups organize the User.

View file

@ -1,15 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: group_orders # Table name: group_orders
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# ordergroup_id :integer default(0), not null # ordergroup_id :integer(4) default(0), not null
# order_id :integer default(0), not null # order_id :integer(4) default(0), not null
# price :decimal(8, 2) default(0.0), not null # price :decimal(8, 2) default(0.0), not null
# lock_version :integer default(0), not null # lock_version :integer(4) default(0), not null
# updated_on :datetime not null # updated_on :datetime not null
# updated_by_user_id :integer # updated_by_user_id :integer(4)
# #
# A GroupOrder represents an Order placed by an Ordergroup. # A GroupOrder represents an Order placed by an Ordergroup.

View file

@ -1,15 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# 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 :integer # result :decimal(8, 3)
# #
# A GroupOrderArticle stores the sum of how many items of an OrderArticle are ordered as part of a GroupOrder. # A GroupOrderArticle stores the sum of how many items of an OrderArticle are ordered as part of a GroupOrder.

View file

@ -1,12 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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
# #

View file

@ -1,13 +1,12 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: invites # Table name: invites
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# token :string(255) default(""), not null # token :string(255) default(""), not null
# expires_at :datetime not null # expires_at :datetime not null
# group_id :integer default(0), not null # group_id :integer(4) default(0), not null
# user_id :integer default(0), not null # user_id :integer(4) default(0), not null
# email :string(255) default(""), not null # email :string(255) default(""), not null
# #

View file

@ -1,21 +1,20 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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(4)
# number :string(255) # number :string(255)
# date :date # date :date
# paid_on :date # paid_on :date
# note :text # note :text
# amount :decimal(8, 2) default(0.0), not null # amount :decimal(8, 2) default(0.0), not null
# created_at :datetime
# updated_at :datetime
# order_id :integer
# deposit :decimal(8, 2) default(0.0), not null # deposit :decimal(8, 2) default(0.0), not null
# deposit_credit :decimal(8, 2) default(0.0), not null # deposit_credit :decimal(8, 2) default(0.0), not null
# created_at :datetime
# updated_at :datetime
# #
class Invoice < ActiveRecord::Base class Invoice < ActiveRecord::Base

View file

@ -1,11 +1,10 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: memberships # Table name: memberships
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# group_id :integer default(0), not null # group_id :integer(4) default(0), not null
# user_id :integer default(0), not null # user_id :integer(4) default(0), not null
# #
class Membership < ActiveRecord::Base class Membership < ActiveRecord::Base

View file

@ -1,15 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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 # private :boolean(1)
# created_at :datetime # created_at :datetime
# #

View file

@ -1,16 +1,15 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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)
# #
@ -185,6 +184,10 @@ class Order < ActiveRecord::Base
order_articles.each do |oa| order_articles.each do |oa|
oa.group_order_articles.each { |goa| goa.group_order_article_quantities.clear } oa.group_order_articles.each { |goa| goa.group_order_article_quantities.clear }
end end
# Stats
# TODO: Move into background, if possible
ordergroups.each { |o| o.update_stats! }
end end
end end
end end

View file

@ -1,16 +1,15 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: order_articles # Table name: order_articles
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# order_id :integer default(0), not null # order_id :integer(4) default(0), not null
# article_id :integer default(0), not null # 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
# units_to_order :integer default(0), not null # units_to_order :integer(4) default(0), not null
# lock_version :integer default(0), not null # lock_version :integer(4) default(0), not null
# article_price_id :integer # article_price_id :integer(4)
# #
# An OrderArticle represents a single Article that is part of an Order. # An OrderArticle represents a single Article that is part of an Order.

View file

@ -1,11 +1,10 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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
# #

View file

@ -1,29 +1,29 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# 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 not null # role_admin :boolean(1) not null
# role_suppliers :boolean not null # role_suppliers :boolean(1) not null
# role_article_meta :boolean not null # role_article_meta :boolean(1) not null
# role_finance :boolean not null # role_finance :boolean(1) not null
# role_orders :boolean not null # role_orders :boolean(1) not null
# weekly_task :boolean # weekly_task :boolean(1)
# 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
# #
# Ordergroups can order, they are "children" of the class Group # Ordergroups can order, they are "children" of the class Group
@ -34,6 +34,7 @@
class Ordergroup < Group class Ordergroup < Group
acts_as_paranoid # Avoid deleting the ordergroup for consistency of order-results acts_as_paranoid # Avoid deleting the ordergroup for consistency of order-results
extend ActiveSupport::Memoizable # Ability to cache method results. Use memoize :expensive_method extend ActiveSupport::Memoizable # Ability to cache method results. Use memoize :expensive_method
serialize :stats
has_many :financial_transactions, :order => "created_on DESC" has_many :financial_transactions, :order => "created_on DESC"
has_many :group_orders has_many :group_orders
@ -41,6 +42,8 @@ class Ordergroup < Group
validates_numericality_of :account_balance, :message => 'ist keine gültige Zahl' validates_numericality_of :account_balance, :message => 'ist keine gültige Zahl'
after_create :update_stats!
def contact def contact
"#{contact_phone} (#{contact_person})" "#{contact_phone} (#{contact_person})"
end end
@ -76,6 +79,23 @@ class Ordergroup < Group
end end
end end
def update_stats!
time = 6.month.ago
jobs = users.collect { |u| u.tasks.done.all(:conditions => ["updated_on > ?", time]).size }.sum
orders_sum = group_orders.collect { |go| go.price if go.order.ends > time }.sum
update_attribute(:stats, {:jobs_size => jobs, :orders_sum => orders_sum})
end
def avg_jobs_per_euro
stats[:orders_sum] != 0 ? stats[:jobs_size].to_f / stats[:orders_sum].to_f : 0
end
# Global average
def self.avg_jobs_per_euro
stats = Ordergroup.all.collect(&:stats)
stats.collect {|s| s[:jobs_size].to_f }.sum / stats.collect {|s| s[:orders_sum].to_f }.sum
end
private private
# If this order group's account balance is made negative by the given/last transaction, # If this order group's account balance is made negative by the given/last transaction,

View file

@ -1,28 +1,27 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# 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(, ) # price :decimal(8, 2)
# tax :float # tax :float
# deposit :decimal(, ) 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
# quantity :integer default(0)
# deleted_at :datetime # deleted_at :datetime
# type :string(255) # type :string(255)
# quantity :integer(4) default(0)
# #
class StockArticle < Article class StockArticle < Article

View file

@ -1,15 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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)
# #
class StockChange < ActiveRecord::Base class StockChange < ActiveRecord::Base

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: suppliers # Table name: suppliers
# #
# 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
# address :string(255) default(""), not null # address :string(255) default(""), not null
# phone :string(255) default(""), not null # phone :string(255) default(""), not null
@ -16,7 +15,7 @@
# delivery_days :string(255) # delivery_days :string(255)
# order_howto :string(255) # order_howto :string(255)
# note :string(255) # note :string(255)
# shared_supplier_id :integer # shared_supplier_id :integer(4)
# min_order_quantity :string(255) # min_order_quantity :string(255)
# deleted_at :datetime # deleted_at :datetime
# #

View file

@ -1,18 +1,17 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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 # done :boolean(1)
# workgroup_id :integer # workgroup_id :integer(4)
# assigned :boolean # assigned :boolean(1)
# 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)
# #
class Task < ActiveRecord::Base class Task < ActiveRecord::Base
@ -29,6 +28,7 @@ class Task < ActiveRecord::Base
validates_length_of :name, :minimum => 3 validates_length_of :name, :minimum => 3
after_save :update_ordergroup_stats
def is_assigned?(user) def is_assigned?(user)
self.assignments.detect {|ass| ass.user_id == user.id } self.assignments.detect {|ass| ass.user_id == user.id }
@ -78,4 +78,12 @@ class Task < ActiveRecord::Base
def user_list def user_list
@user_list ||= users.collect(&:nick).join(", ") @user_list ||= users.collect(&:nick).join(", ")
end end
private
def update_ordergroup_stats
if done
users.each { |u| u.ordergroup.update_stats! }
end
end
end end

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# Table name: users # Table name: users
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# nick :string(255) default(""), not null # nick :string(255) default(""), not null
# password_hash :string(255) default(""), not null # password_hash :string(255) default(""), not null
# password_salt :string(255) default(""), not null # password_salt :string(255) default(""), not null

View file

@ -1,29 +1,29 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# 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 not null # role_admin :boolean(1) not null
# role_suppliers :boolean not null # role_suppliers :boolean(1) not null
# role_article_meta :boolean not null # role_article_meta :boolean(1) not null
# role_finance :boolean not null # role_finance :boolean(1) not null
# role_orders :boolean not null # role_orders :boolean(1) not null
# weekly_task :boolean # weekly_task :boolean(1)
# 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
# #
class Workgroup < Group class Workgroup < Group

24
app/views/home/_stats.erb Normal file
View file

@ -0,0 +1,24 @@
<%
max_width = 600
global_avg = Ordergroup.avg_jobs_per_euro
group_avg = @ordergroup.avg_jobs_per_euro.to_f
length_of_global_bar = max_width / 2.0
length_of_group_bar = (group_avg / global_avg) * length_of_global_bar
length_of_group_bar = max_width if length_of_group_bar > max_width
color = group_avg >= global_avg ? "#78b74e" : "red"
%>
Engagement Deiner Bestellgruppe
<div class="stats-bar" style="width:<%= length_of_group_bar -%>px; background-color:<%= color -%>">
<%= ((group_avg / global_avg) * 100).to_i -%><%= " Äpfel" if length_of_group_bar > 50 -%>
</div>
Durchschnittsengagement
<div class="stats-bar" style="width:<%= length_of_global_bar -%>px">
100 Birnen
</div>
<span class="description">
Abgebildet ist das Verhältnis von erledigten Aufgaben zu dem Bestellvolumen Deiner Bestellgruppe im Vergleich zum Durchschnitt in der Foodcoop.
</span>

View file

@ -31,6 +31,12 @@
// Current orders // Current orders
= render :partial => 'shared/open_orders' = render :partial => 'shared/open_orders'
// Stats
.box_title
%h2 Engagement Deiner Bestellgruppe
.column_content
= render "stats"
- unless @messages.empty? - unless @messages.empty?
.box_title .box_title
%h2 Neuste Nachrichten %h2 Neuste Nachrichten
@ -49,9 +55,9 @@
| |
Verfügbares Guthaben: Verfügbares Guthaben:
= number_to_currency(@ordergroup.get_available_funds()) = number_to_currency(@ordergroup.get_available_funds())
%span{:style => "color:grey"} %span.description
(zuletzt aktualisiert vor (Letzte Aktualisierung ist
= distance_of_time_in_words(Time.now, @ordergroup.account_updated) + "(n))" = distance_of_time_in_words(Time.now, @ordergroup.account_updated) + " her)"
%h3 Letzte Transaktionen %h3 Letzte Transaktionen
%table %table
%tr %tr

View file

@ -0,0 +1,11 @@
class AddStatsToGroups < ActiveRecord::Migration
def self.up
add_column :groups, :stats, :text
Ordergroup.all.each { |o| o.update_stats! }
end
def self.down
remove_column :groups, :stats
end
end

View file

@ -9,7 +9,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20090405131156) do ActiveRecord::Schema.define(:version => 20090731132547) do
create_table "article_categories", :force => true do |t| create_table "article_categories", :force => true do |t|
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
@ -135,6 +135,7 @@ ActiveRecord::Schema.define(:version => 20090405131156) do
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"
end end
add_index "groups", ["name"], :name => "index_groups_on_name", :unique => true add_index "groups", ["name"], :name => "index_groups_on_name", :unique => true

View file

@ -81,6 +81,13 @@ option {
span.click-me { span.click-me {
cursor: pointer; } cursor: pointer; }
.clear {
clear: both; }
.description {
color: grey;
font-size: 0.9em; }
#login { #login {
margin: auto; margin: auto;
width: 27em; width: 27em;
@ -433,3 +440,11 @@ ul.autocomplete .informal {
position: relative; position: relative;
top: -1em; top: -1em;
left: 5%; } left: 5%; }
.stats-bar {
height: 20px;
min-width: 10px;
border: 1px solid #DDDDDD;
background-color: #fff;
text-align: center;
margin: 0 10px 10px 0; }

View file

@ -81,6 +81,13 @@ option {
span.click-me { span.click-me {
cursor: pointer; } cursor: pointer; }
.clear {
clear: both; }
.description {
color: grey;
font-size: 0.9em; }
#login { #login {
margin: auto; margin: auto;
width: 27em; width: 27em;
@ -434,6 +441,14 @@ ul.autocomplete .informal {
top: -1em; top: -1em;
left: 5%; } left: 5%; }
.stats-bar {
height: 20px;
min-width: 10px;
border: 1px solid #DDDDDD;
background-color: #fff;
text-align: center;
margin: 0 10px 10px 0; }
#logininfo, #header, #footer { #logininfo, #header, #footer {
display: none; } display: none; }

View file

@ -91,6 +91,13 @@ option
span.click-me span.click-me
cursor: pointer cursor: pointer
.clear
clear: both
.description
color: grey
font-size: 0.9em
// ********************************* loginpage // ********************************* loginpage
#login #login
:margin auto :margin auto
@ -480,3 +487,12 @@ ul.autocomplete
position: relative position: relative
top: -1em top: -1em
left: 5% left: 5%
// group stats
.stats-bar
height: 20px
min-width: 10px
border: 1px solid #DDDDDD
background-color: #fff
text-align: center
margin: 0 10px 10px 0

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: article_categories # Table name: article_categories
# #
# 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)
# #

View file

@ -1,14 +1,13 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: article_prices # Table name: article_prices
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# article_id :integer # article_id :integer(4)
# price :decimal(8, 2) default(0.0), not null # price :decimal(8, 2) default(0.0), not null
# tax :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 # deposit :decimal(8, 2) default(0.0), not null
# unit_quantity :integer # unit_quantity :integer(4)
# created_at :datetime # created_at :datetime
# #

View file

@ -1,28 +1,27 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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(, ) # price :decimal(8, 2)
# tax :float # tax :float
# deposit :decimal(, ) 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
# quantity :integer default(0)
# deleted_at :datetime # deleted_at :datetime
# type :string(255) # type :string(255)
# quantity :integer(4) default(0)
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

View file

@ -1,12 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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 # accepted :boolean(1)
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

View file

@ -1,13 +1,12 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: financial_transactions # Table name: financial_transactions
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# ordergroup_id :integer default(0), not null # ordergroup_id :integer(4) default(0), not null
# amount :decimal(8, 2) default(0.0), not null # amount :decimal(8, 2) default(0.0), not null
# note :text not null # note :text default(""), not null
# user_id :integer default(0), not null # user_id :integer(4) default(0), not null
# created_on :datetime not null # created_on :datetime not null
# #

View file

@ -1,12 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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
# #

View file

@ -1,29 +1,29 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# 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 not null # role_admin :boolean(1) not null
# role_suppliers :boolean not null # role_suppliers :boolean(1) not null
# role_article_meta :boolean not null # role_article_meta :boolean(1) not null
# role_finance :boolean not null # role_finance :boolean(1) not null
# role_orders :boolean not null # role_orders :boolean(1) not null
# weekly_task :boolean # weekly_task :boolean(1)
# 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
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

View file

@ -1,11 +1,10 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# Table name: memberships # Table name: memberships
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# group_id :integer default(0), not null # group_id :integer(4) default(0), not null
# user_id :integer default(0), not null # user_id :integer(4) 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

View file

@ -1,15 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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 # private :boolean(1)
# created_at :datetime # created_at :datetime
# #

View file

@ -1,11 +1,10 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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
# #

View file

@ -1,16 +1,15 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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)
# #

View file

@ -1,15 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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

View file

@ -1,5 +1,4 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# Table name: suppliers # Table name: suppliers
# #

View file

@ -1,18 +1,17 @@
# == Schema Information # == Schema Information
# Schema version: 20090119155930
# #
# 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 # done :boolean(1)
# workgroup_id :integer # workgroup_id :integer(4)
# assigned :boolean # assigned :boolean(1)
# 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)
# #
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090120184410
# #
# Table name: users # Table name: users
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# nick :string(255) default(""), not null # nick :string(255) default(""), not null
# password_hash :string(255) default(""), not null # password_hash :string(255) default(""), not null
# password_salt :string(255) default(""), not null # password_salt :string(255) default(""), not null

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# Table name: article_categories # Table name: article_categories
# #
# 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)
# #

View file

@ -1,14 +1,13 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# Table name: article_prices # Table name: article_prices
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# article_id :integer # article_id :integer(4)
# price :decimal(8, 2) default(0.0), not null # price :decimal(8, 2) default(0.0), not null
# tax :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 # deposit :decimal(8, 2) default(0.0), not null
# unit_quantity :integer # unit_quantity :integer(4)
# created_at :datetime # created_at :datetime
# #

View file

@ -1,28 +1,27 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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(, ) # price :decimal(8, 2)
# tax :float # tax :float
# deposit :decimal(, ) 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
# quantity :integer default(0)
# deleted_at :datetime # deleted_at :datetime
# type :string(255) # type :string(255)
# quantity :integer(4) default(0)
# #
require File.dirname(__FILE__) + '/../test_helper' require File.dirname(__FILE__) + '/../test_helper'

View file

@ -1,12 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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 # accepted :boolean(1)
# #
require File.dirname(__FILE__) + '/../test_helper' require File.dirname(__FILE__) + '/../test_helper'

View file

@ -1,13 +1,12 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# Table name: financial_transactions # Table name: financial_transactions
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# ordergroup_id :integer default(0), not null # ordergroup_id :integer(4) default(0), not null
# amount :decimal(8, 2) default(0.0), not null # amount :decimal(8, 2) default(0.0), not null
# note :text not null # note :text default(""), not null
# user_id :integer default(0), not null # user_id :integer(4) default(0), not null
# created_on :datetime not null # created_on :datetime not null
# #

View file

@ -1,12 +1,11 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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
# #

View file

@ -1,29 +1,29 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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 not null # role_admin :boolean(1) not null
# role_suppliers :boolean not null # role_suppliers :boolean(1) not null
# role_article_meta :boolean not null # role_article_meta :boolean(1) not null
# role_finance :boolean not null # role_finance :boolean(1) not null
# role_orders :boolean not null # role_orders :boolean(1) not null
# weekly_task :boolean # weekly_task :boolean(1)
# 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
# #
require File.dirname(__FILE__) + '/../test_helper' require File.dirname(__FILE__) + '/../test_helper'

View file

@ -1,11 +1,10 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# Table name: memberships # Table name: memberships
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# group_id :integer default(0), not null # group_id :integer(4) default(0), not null
# user_id :integer default(0), not null # user_id :integer(4) default(0), not null
# #
require File.dirname(__FILE__) + '/../test_helper' require File.dirname(__FILE__) + '/../test_helper'

View file

@ -1,11 +1,10 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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
# #

View file

@ -1,16 +1,15 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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)
# #

View file

@ -1,28 +1,27 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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(, ) # price :decimal(8, 2)
# tax :float # tax :float
# deposit :decimal(, ) 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
# quantity :integer default(0)
# deleted_at :datetime # deleted_at :datetime
# type :string(255) # type :string(255)
# quantity :integer(4) default(0)
# #
require 'test_helper' require 'test_helper'

View file

@ -1,15 +1,14 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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)
# #
require 'test_helper' require 'test_helper'

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# Table name: suppliers # Table name: suppliers
# #
# 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
# address :string(255) default(""), not null # address :string(255) default(""), not null
# phone :string(255) default(""), not null # phone :string(255) default(""), not null
@ -16,7 +15,7 @@
# delivery_days :string(255) # delivery_days :string(255)
# order_howto :string(255) # order_howto :string(255)
# note :string(255) # note :string(255)
# shared_supplier_id :integer # shared_supplier_id :integer(4)
# min_order_quantity :string(255) # min_order_quantity :string(255)
# deleted_at :datetime # deleted_at :datetime
# #

View file

@ -1,18 +1,17 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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 # done :boolean(1)
# workgroup_id :integer # workgroup_id :integer(4)
# assigned :boolean # assigned :boolean(1)
# 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)
# #
require File.dirname(__FILE__) + '/../test_helper' require File.dirname(__FILE__) + '/../test_helper'

View file

@ -1,9 +1,8 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# Table name: users # Table name: users
# #
# id :integer not null, primary key # id :integer(4) not null, primary key
# nick :string(255) default(""), not null # nick :string(255) default(""), not null
# password_hash :string(255) default(""), not null # password_hash :string(255) default(""), not null
# password_salt :string(255) default(""), not null # password_salt :string(255) default(""), not null

View file

@ -1,29 +1,29 @@
# == Schema Information # == Schema Information
# Schema version: 20090317175355
# #
# 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 not null # role_admin :boolean(1) not null
# role_suppliers :boolean not null # role_suppliers :boolean(1) not null
# role_article_meta :boolean not null # role_article_meta :boolean(1) not null
# role_finance :boolean not null # role_finance :boolean(1) not null
# role_orders :boolean not null # role_orders :boolean(1) not null
# weekly_task :boolean # weekly_task :boolean(1)
# 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
# #
require 'test_helper' require 'test_helper'