@@ -1,5 +1,4 @@ | |||||
require 'rubygems' | require 'rubygems' | ||||
# gem "datamapper", "0.9.11" | |||||
require 'dm-core' | require 'dm-core' | ||||
require 'dm-validations' | require 'dm-validations' | ||||
require 'dm-timestamps' | require 'dm-timestamps' | ||||
@@ -37,7 +36,6 @@ class Directorate | |||||
property :name, String, :length => 255, :required => true | property :name, String, :length => 255, :required => true | ||||
property :slug, String, :length => 255 | property :slug, String, :length => 255 | ||||
# has n, :payments, { :through => :services, :order => ['d'] } | |||||
has n, :services, :order => ['name'] | has n, :services, :order => ['name'] | ||||
has n, :suppliers, { :through => :services, :order => ['name'] } | has n, :suppliers, { :through => :services, :order => ['name'] } | ||||
@@ -39,7 +39,8 @@ | |||||
%tr | %tr | ||||
%th Date | %th Date | ||||
%th Ref. | %th Ref. | ||||
%th Directorate | |||||
-# | |||||
%th Directorate | |||||
%th Service | %th Service | ||||
%th.right £ | %th.right £ | ||||
@@ -49,16 +50,18 @@ | |||||
%td | %td | ||||
%a{ :href => "/payments/#{payment.id}" } | %a{ :href => "/payments/#{payment.id}" } | ||||
= payment.id | = payment.id | ||||
%td | |||||
%a{ :href => '/directorates/' + payment.directorate.slug } | |||||
= payment.directorate.name | |||||
-# | |||||
%td | |||||
%a{ :href => '/directorates/' + payment.directorate.slug } | |||||
= payment.directorate.name | |||||
%td | %td | ||||
%a{ :href => '/services/' + payment.service.slug } | %a{ :href => '/services/' + payment.service.slug } | ||||
= payment.service.name | = payment.service.name | ||||
%td.right= sprintf("%0d", payment.amount) | %td.right= sprintf("%0d", payment.amount) | ||||
%tr | %tr | ||||
%td | |||||
-# | |||||
%td | |||||
%td | %td | ||||
%td | %td | ||||
%td | %td | ||||