Need help designing model for beekeeper

Hi, I’m a beekeeper, and try to write on RoR an app to follow my hives. Actually, I have this structure

class Hive < ApplicationRecord has_many :moves, dependent: :destroy has_many :yards, through: :moves has_many :visits has_many :varroas

class Move < ApplicationRecord belongs_to :hive belongs_to :yard

after_create :mark_most_recent

def mark_most_recent
  hive.moves.order(:created_at => :desc).offset(1).update_all(:most_recent => false)
  hive.moves.order(:created_at => :desc).limit(1).update_all(:most_recent => true)

class Yard < ApplicationRecord has_many :moves, -> { where(:most_recent => true) } has_many :hives, through: :moves belongs_to :owner

has_many :most_recents_moves, -> { where(:most_recent => true) }, :class_name => ‘Move’ scope :last_move_completed, -> { joins(:moves).where(‘moves.most_recent=?’, true)}

class Visit < ApplicationRecord belongs_to :hive belongs_to :visittype

My problem is that I need to add a step between the hive and the other models (varroas, visits), this step is colonies. A colony can only be in one hive at a time, but can be moved to another hive for some reason. And i want to keep the history. It is the colony that I visit, and it is the colony who have varroas, but in the yard, my reference is the hive_id. By visiting a hive, i know his ID, but I visit the colony. Who can later be moved in another hive. Sorry for my poor english. I hope that someone will be able to help me. What is the best relationship for my model? And BTW, did I chose the correct relationship for the relation between hives, moves and yards ?

Thank you,