def define_rid_accessors(related_class, relationship_name)
      define_method("#{relationship_name}_rid") do
        self.send(relationship_name).try(random_unique_id_options[:field])
      end

      define_method("#{relationship_name}_rid=") do |rid|
        record = related_class.find_by_rid(rid)
        self.send("#{relationship_name}=", record)
        record
      end
    end
def define_rid_accessors(related_class, relationship_name)
      define_method("#{relationship_name}_rid") do
        self.send(relationship_name).try(random_unique_id_options[:field])
      end

      define_method("#{relationship_name}_rid=") do |rid|
        record = related_class.find_by_rid(rid)
        self.send("#{relationship_name}=", record)
        record
      end
    end
Defines the setter and getter for the RID of a relationship.

 @param related_class [Class] class in which the RID methods are going to be defined.
 @param relationship_name [String] name of the relationship for which the RID methods are going to be defined.
 @see RandomUniqueId::ClassMethods.belongs_to