Updated has_many and belongs_to relationships in models