Skip to content

Instantly share code, notes, and snippets.

@cihad
Created March 20, 2013 11:09
Show Gist options
  • Save cihad/5203894 to your computer and use it in GitHub Desktop.
Save cihad/5203894 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
has_many :transactions, as: :transactionable
end
class Investment < ActiveRecord::Base
has_many :transactions, as: :transactionable
end
# class System ??????? end
class Transaction < ActiveRecord::Base
belongs_to :transactionable, polymorphic: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment