标签:als span persist nbsp new active database use rail
https://joe11051105.gitbooks.io/you-need-to-know-about-ruby-on-rails/content/activerecord/persisted_vs_new_record.html persisted? vs new_record? Explain ● persisted? 判斷是否已經存入 database 且不是新增的資料 ● new_record? 判斷是否是新增資料 Eaample user = User.new user.new_record? # true user.persisted? # false user = User.first user.new_record? # false user.persisted? # true
标签:als span persist nbsp new active database use rail
原文地址:http://www.cnblogs.com/znsongshu/p/6080229.html