Skip to content

Instantly share code, notes, and snippets.

@methodmissing
Created July 25, 2008 23:43
Show Gist options
  • Save methodmissing/2557 to your computer and use it in GitHub Desktop.
Save methodmissing/2557 to your computer and use it in GitHub Desktop.
module Accountable
class Transaction < ::ActiveRecord::Base # to ensure not clashing with Accountable::ActiveRecord::Macro
has_many :credits
has_many :debits
end
end
module Accountable
module Accounts
class Base < ::ActiveRecord::Base #see above
end
end
end
module Accountable
module Accounts
module Debit
class Base < Accountable::Accounts::Base # not from the same dir, reference the whole constant
end
end
end
end
module Accountable
module Accounts
module Debit
class Expense < Base # from the same dir, reference partial constant, since it belongs to the same module
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment