Create note on discontinued development
[merb_mart.git] / app / models / accounts / abstract_account.rb
blob8cbb3363090ddf07232a70c4bee596c98434fa09
1 require 'dm-validations'
3 module Mart
4   module Accounts
5     class AbstractAccount
7       include DataMapper::Resource
8       include DataMapper::Validate
9       require 'ezcrypto'
11       property :id,           Integer, :serial => true
12       property :type,         Class   # single-table inheritance
13       property :order_id,     Integer  # foreign-key
14       property :customer_id,  Integer  # foreign-key
16       has 1, :order
17       belongs_to :customer #, :accessor => :protected
19       def self.months
20         (1..12).to_a
21       end
23       def self.years
24         year = Date.today.year
25         years = Array.new
26         (0..9).each do |n|
27           years << year + n
28         end
29         years
30       end
32     end
33   end
34 end