def check_instance_model
      model = self.class.model
      if @instance
        # Pry alters models in such a way that the first check may fail when it 
        # shouldn't. The second should still be fairly safe.
        unless @instance.is_a?(model) || @instance.class.name == model.name
          raise TypeError.new "Instance #{@instance} is not a #{model}"
        end
      else
        raise TypeError.new("Please specify a model class to create") unless model.is_a? Class
      end
    end
def check_instance_model
      model = self.class.model
      if @instance
        # Pry alters models in such a way that the first check may fail when it 
        # shouldn't. The second should still be fairly safe.
        unless @instance.is_a?(model) || @instance.class.name == model.name
          raise TypeError.new "Instance #{@instance} is not a #{model}"
        end
      else
        raise TypeError.new("Please specify a model class to create") unless model.is_a? Class
      end
    end
-----------