2017-07-09 13:41:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2009-05-01 11:01:13 -04:00
|
|
|
class Face < ActiveRecord::Base
|
2016-08-06 13:37:57 -04:00
|
|
|
belongs_to :man, inverse_of: :face
|
2018-02-05 07:40:44 -05:00
|
|
|
belongs_to :human, polymorphic: true
|
2016-08-06 13:37:57 -04:00
|
|
|
belongs_to :polymorphic_man, polymorphic: true, inverse_of: :polymorphic_face
|
2015-09-07 11:56:09 -04:00
|
|
|
# Oracle identifier length is limited to 30 bytes or less, `polymorphic` renamed `poly`
|
2016-08-06 13:37:57 -04:00
|
|
|
belongs_to :poly_man_without_inverse, polymorphic: true
|
2009-12-28 08:13:33 -05:00
|
|
|
# These is a "broken" inverse_of for the purposes of testing
|
2016-08-06 13:37:57 -04:00
|
|
|
belongs_to :horrible_man, class_name: "Man", inverse_of: :horrible_face
|
|
|
|
belongs_to :horrible_polymorphic_man, polymorphic: true, inverse_of: :horrible_polymorphic_face
|
2017-11-24 07:22:35 -05:00
|
|
|
|
|
|
|
validate do
|
|
|
|
man
|
|
|
|
end
|
2009-05-01 11:01:13 -04:00
|
|
|
end
|