0
過時了,我得到了以下已過時警告serialized_attributes時無需更換
DEPRECATION WARNING: `serialized_attributes` is deprecated without replacement, and will be removed in Rails 5.0.
,這裏是我的控制器樣品的方法
def update
@test = Test.unscoped.find(params[:id])
@test.name = params[:test][:name]
@test.abbreviation = params[:test][:abbreviation]
if @test.save
redirect_to action: :index
else
@test.errors.delete(:cover_image_content_type)
flash[:error] = @test.errors.messages.to_yaml
redirect_to action: :show
end
末
注:另外我在我的測試模型中有has_paper_trail版本::paper_trail_version。如何解決這個棄用問題,這將支持我升級到Rails 5時?
好,但一旦我們升級paper_trail將棄用這還不是一個問題,當我升級到Rails 5? – Radhika
不這麼認爲,修正是從v4.0開始的,並且在Rails 5中得到了支持https://github.com/airblade/paper_trail/commit/3a173678459d01c1b6d4622a5116867205df8788 – kasperite