开发者

Rails 3 new_record? deprecated

开发者 https://www.devze.com 2023-02-19 22:20 出处:网络
I have a Rails 3 app and I am planning to use the ActiveRecord method new_record? on my shared form to show the user either a Create or Update button. I looked at APIDock and 开发者_StackOverflowfor t

I have a Rails 3 app and I am planning to use the ActiveRecord method new_record? on my shared form to show the user either a Create or Update button. I looked at APIDock and 开发者_StackOverflowfor this method and it says

Method Deprecated: This method is deprecated on the latest stable version of Rails. The last existing version (v2.3.8) is shown here.

What exactly does that mean? Does it mean that it will no longer be available moving forward?


ActiveRecord::Persistence makes no mention of deprecation... I believe APIDock is simply fooled by the restructuring of the classes. If the method were deprecated, rails would generate a warning when it was used.

see: http://apidock.com/rails/ActiveRecord/Persistence/new_record%3F

0

精彩评论

暂无评论...
验证码 换一张
取 消