是否有一个替代update_attributes不保存记录?
所以我可以这样做:
@car = Car.new(:make => 'GMC')
#other processing
@car.update_attributes(:model => 'Sierra', :year => "2012", :looks => "Super Sexy, wanna make love to it")
#other processing
@car.save
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我知道我可以@car.model = 'Sierra',但我想在一条线上更新它们.
ruby ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 rails-activerecord