• G
    Prevent a 500 in the default controller scaffold · c83ace7b
    Genadi Samokovarov 提交于
    If you update a record with no attributes, you'll hit a 500 from a guard
    in `assign_attributes` raising:
    
    ```ruby
    ArgumentError: When assigning attributes, you must pass a hash as an argument.
        app/controllers/users_controller.rb:44:in `block in update'
        app/controllers/users_controller.rb:43:in `update'
        test/controllers/users_controller_test.rb:37:in `block in <class:UsersControllerTest>'
    ```
    
    Not a biggie, but may be quite confusing for the folks new to the
    framework.
    c83ace7b
api_controller.rb 1.8 KB