0
我在application.rb中有這條線config.filter_parameters += [:password, :efile, :title]
。
但是,當我試圖挽救這樣一個模型:Rails 3爲什麼filter_parameters不起作用
@claim_db[:xml] = xml_builder.to_xml.gsub('utf-8', 'utf-16')
@claim_db[:title] = title.present? ? title : nil
@claim_db[:applicants] = applicants.present? ? applicants : nil
@claim_db[:native_number] = nn.present? ? nn : nil
@claim_db[:change_date] = Time.now
@claim_db[:is_signed] = false
@claim_db[:with_errors] = errors.count > 0
@claim_db.save!
在日誌中得到:
←[1m←[36mAREL (2.0ms)←[0m ←[1mINSERT INTO [edocs] ([eclaim_id], [materialtitl
e_id], [is_secondary], [title], [ext], [size], [code], [receive_date], [reg_date
], [reg_numb], [idcead], [efile]) VALUES (100003, 7, 0, N'test', N'rtf', 4, N'test', '2012-05-11 21:05:12
.125', NULL, NULL, NULL, 0x61737373)←[0m
←[1m←[35mEXECUTE (0.0ms)←[0m COMMIT TRANSACTION
我怎樣才能解決呢?
開發模式沒有禁用特定字段記錄的解決方案。我對嗎? –