module ActionView::Helpers::ActiveModelInstanceTag

def object

def object
  @active_model_object ||= begin
    object = super
    object.respond_to?(:to_model) ? object.to_model : object
  end
end