My first thought would be to use single-table inheritance, since Orphan is a specific kind of child with different behaviors.
When deciding whether this is the right route, I found this post really helpful.
If you chose use STI, you'd end up with something like...
class Child < ActiveRecord::Base
end
class Orphan < Child
has_one :parent
end
class StereotypicalFamilyUnit < Child
has_many :parents
end
Rails will also assume and expect that you have a "type" string column in the Child table. When you call Orphan.new, it will create a child of type "Orphan." And if you do "Orphan.first" it's basically doing Child.where(type: "Orphan").first behind the scenes.
Another option (which I eventually opted for in an app I'm building in lieu of STI), would be to have a boolean as you suggested and use scopes, which might look like:
class Child < ActiveRecord::Base
has_many :parents
scope :orphan, -> { where(orphan: true) }
end
Which lets you instead call Child.orphan.new or Child.orphan.first, and do different things in views/controllers when orphan is true. You could then also follow the advice in this prior post to create a custom validation for orphans.