2017-07-09 13:41:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2009-05-01 11:01:13 -04:00
|
|
|
class Face < ActiveRecord::Base
|
2020-08-13 18:11:28 -04:00
|
|
|
belongs_to :human, inverse_of: :face
|
2020-06-29 16:28:20 -04:00
|
|
|
belongs_to :autosave_human, class_name: "Human", foreign_key: :human_id, inverse_of: :autosave_face
|
2020-08-13 18:11:28 -04:00
|
|
|
belongs_to :super_human, polymorphic: true
|
|
|
|
belongs_to :polymorphic_human, 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`
|
2020-08-13 18:11:28 -04:00
|
|
|
belongs_to :poly_human_without_inverse, polymorphic: true
|
2019-05-28 12:12:25 -04:00
|
|
|
# These are "broken" inverse_of associations for the purposes of testing
|
2020-08-25 11:02:41 -04:00
|
|
|
belongs_to :puzzled_human, class_name: "Human", inverse_of: :puzzled_face
|
|
|
|
belongs_to :puzzled_polymorphic_human, polymorphic: true, inverse_of: :puzzled_polymorphic_face
|
2017-11-24 07:22:35 -05:00
|
|
|
|
|
|
|
validate do
|
2020-08-13 18:11:28 -04:00
|
|
|
human
|
2017-11-24 07:22:35 -05:00
|
|
|
end
|
2009-05-01 11:01:13 -04:00
|
|
|
end
|