Rails valiation among a three model relationship
- by Andrew
I'm working on a three model relationship with one aspect that I'm not sure how to approach. Here's the basic relationship:
class Taxonomy
has_many :terms
# attribute: `inclusive`, default => false
end
class Term
belongs_to :taxonomy
has_and_belongs_to_many :photos
end
class Photo
has_and_belongs_to_many :terms
end
This is pretty…