belongs_to is used when the child object doesn't exist without the parent model. In your case, the feature_photo needs to be related to a gallery and it can't exist independently. Hence using has_one makes sense. If you are using mongodb, you can use the embeds_one relationship. Refer http://two.mongoid.org/docs/relations/embedded/1-1.html
In the above scenario, Gallery has_many Photos and Gallery has_one feature_photo. You can handle this in two way.
1) Add a boolean field in photos table denoting whether it is a feature photo or not. the problem with this approach that only one photo is going have a 'true' value for the field. If you have a large collection of photos, you are going to waste a lot of space for saving true/false value.
2) Add a feature_photo_id field in gallery and store the id of a photo. Write a method to retrieve the feature_photo. The problem with this approach is that you have to write all the logic yourself.
class Gallery
has_many :photos
def feature_photo
photos.where(id: feature_photo_id).first
end
end
I would prefer the second approach.