Created
April 16, 2014 20:08
-
-
Save erkattak/10927738 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Allocation < AR::Base | |
# allocations schema | |
# - line_item_id - indexed | |
# - type - string [ ‘CreditAllocation’, ‘DebitAllocation’ ] - indexed | |
# - allocatable_id - integer - indexed | |
# - amount - integer | |
belongs_to :line_item | |
belongs_to :allocatable, class_name: ‘LineItem’ | |
end | |
class CreditAllocation < Allocation | |
end | |
class DebitAllocation < Allocation | |
end | |
class Violation < AR::Base | |
belongs_to :line_item | |
# join payments via allocations | |
# join adjustments via allocations | |
end | |
class LineItem < AR::Base | |
has_many :violations | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment