Skip to content

Instantly share code, notes, and snippets.

@antonversal
Created May 9, 2012 15:59
Show Gist options
  • Save antonversal/2645895 to your computer and use it in GitHub Desktop.
Save antonversal/2645895 to your computer and use it in GitHub Desktop.
class Account < ActiveRecord::Base
has_may :piece_of_works
# some code
end
class Customer < Account
has_many :projects
end
class Supplier < Account
has_many :jobs
end
class PieceOfWork < ActiveRecord::Base
belongs_to :account
end
class Project < PieceOfWork
belongs_to :customer
end
class Job < PieceOfWork
belongs_to :supplier
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment