When we use friendly_id, Rails can't update multiple records at a time. Here's my controller line which update the records :
@submitsup = Photo.update(params[:submits].keys, params[:submits].values)
Here's the error I get :
ActiveRecord::RecordNotFound (Couldn't find Photo with 'id'=hello-world)
It have used the slug as the ID. How can I fix this? (Please note that I update multiple records at the same time.)
Generated params (updated with the id):
{"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"3WERrJpTdyzzpepkjpzMAZFV67Ogw6yWBICOE/s0o6TgGotO9OpFIFygt7q/oEBcVDNLNkP52cr2PSJ5qWwInQ==", "submits"=>{"hello-world"=>{"accepted"=>"1", "rejectreason"=>"", "id"=>"15922356", "category"=>"Technology", "tags"=>"{hello,go,web}", "nsfw"=>"0"}, "hello-world-37380779"=>{"accepted"=>"0", "rejectreason"=>"", "id"=>"37380779", "category"=>"Technology", "tags"=>"{hello,go,web}", "nsfw"=>"0"}}, "commit"=>"Update All", "controller"=>"dash", "action"=>"update_submits"}