Sha256: ef38f75d7c0a173e5207cfcf25ddfb20cd8cea1a3b360c0b4b7614a2888f34f8
Contents?: true
Size: 362 Bytes
Versions: 1
Compression:
Stored size: 362 Bytes
Contents
class Person < ActiveRecord::Base has_many :relationships, autosave: true, dependent: :destroy, foreign_key: 'person_from' has_many :children, { autosave: true, dependent: :destroy, foreign_key: 'person_to' }, -> { where(name: 'child') } has_one :father, { autosave: true, dependent: :destroy, foreign_key: 'person_to' }, -> { where(name: 'father') } end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kadmin-0.1.4 | test/dummy/app/models/person.rb |