Rails ActiveRecord How Can I turn off logging particular queries
问题 I am under developer mode in Rails. I am trying to insert a record with binary data to DB using AR. Edoc.create( :id_claim => @claim_index, :id_material => @doc_code, :size => @file_list.first[:size], :efile => params[:files][0].read ) But It takes a lot of time because Rails logs that query with entire file content. How Can I turn off logging particular queries? 回答1: Try: old_logger = ActiveRecord::Base.logger ActiveRecord::Base.logger = nil # your code here... Restore logger: ActiveRecord: