1. 13 7月, 2018 1 次提交
    • E
      e4e1b620 broke `to_param` handling: · 48b6bacb
      Edouard CHIN 提交于
      - There was an issue inside controller tests where order params were not respected, the reason
        was because we were calling `Hash#to_query` which sorts the results lexicographically.
        1e4e1b62 fixed that issue by not using `to_query` but instead a utility function provided by rack.
      - However with the fix came another issue where it's now no longer possible to do this
      
        ```
         post :foo, params: { user: User.first }
      
         # Prior to the patch the controller will receive { "user" => "1" }
         # Whereas now you get { "user": "#<User: ...>" }
        ```
      
        The fix in this PR is to modify `Hash#to_query` to sort only when it
        doesn't contain an array structure that looks something like "bar[]"
      
        Ref https://github.com/rails/rails/pull/33341#issuecomment-404039396
      48b6bacb
  2. 09 7月, 2018 7 次提交
  3. 08 7月, 2018 11 次提交
  4. 07 7月, 2018 6 次提交
    • K
      Don't balloon @original_options with --restart on restart. · 1d97b8f9
      Kasper Timm Hansen 提交于
      Our restart_command would pass in `--restart` which means
      that if the @original_options already contains --restart
      it would keep getting another --restart appended.
      
      Nothing here that would break the bank, but just a nicety.
      1d97b8f9
    • K
      Don't show unneeded deprecation warning on server restart. · 161ed37d
      Kasper Timm Hansen 提交于
      If booting a server via `rails s -u puma`, we'd convert the
      option to a `using` positional.
      
      When using `rails restart` our `restart_command` would the
      option converted to the using positional and put that in
      the restart command.
      
      Thus we'd show users deprecation warnings for our own code.
      
      Fix that by converting a passed positional to an option instead.
      
      Also: fix initialize method signature. The local_options are an
      array, not a hash. But don't even bother assigning defaults as
      Thor passes them in.
      161ed37d
    • K
      Remove restart_command leftover from switching to Thor options. · 688e48d9
      Kasper Timm Hansen 提交于
      Ref:
      https://github.com/rails/rails/commit/654704247eba742e139cfaa8d1385f13605d9e12
      
      Before the commit we had a restart_command in Rails::Server. But after
      there's another one in Rails::ServerCommand. The command version of the
      method is the right one as it's used in server_options.
      
      Give the leftover method the boot.
      688e48d9
    • K
      Use only snake cased symbols in commands. · b773318f
      Kasper Timm Hansen 提交于
      Mixing strings and symbols seems aesthetically less than ideal.
      
      We can also use underscores just fine. Thor converts them to dashes
      for the CLI and it makes access in Ruby code nicer.
      
      Here's the `server --help` output after this change:
      
      ```
      Usage:
        rails server [thin/puma/webrick] [options]
      
      Options:
        -p, [--port=port]                        # Runs Rails on the specified port - defaults to 3000.
        -b, [--binding=IP]                       # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'.
        -c, [--config=file]                      # Uses a custom rackup configuration.
                                                 # Default: config.ru
        -d, [--daemon], [--no-daemon]            # Runs server as a Daemon.
        -e, [--environment=name]                 # Specifies the environment to run this server under (development/test/production).
        -u, [--using=name]                       # Specifies the Rack server used to run the application (thin/puma/webrick).
        -P, [--pid=PID]                          # Specifies the PID file.
                                                 # Default: tmp/pids/server.pid
        -C, [--dev-caching], [--no-dev-caching]  # Specifies whether to perform caching in development.
            [--early-hints], [--no-early-hints]  # Enables HTTP/2 early hints.
      ```
      
      See? Quite dashing 
      b773318f
    • B
      Improve `SecurePasswordTest#test_authenticate` · 382b5ca7
      bogdanvlviv 提交于
      - Ensure that execution of `authenticate`/`authenticate_XXX` returns
      `self` if password is correct, otherwise `false` (as mentioned in the documentation).
      - Test `authenticate_password`.
      382b5ca7
    • B
      Update `has_secure_password` info in the guide · 73a9f640
      bogdanvlviv 提交于
      `has_secure_password` allows configuring name of attribute since #26764.
      This commit adds a mention about it in the Active Model Basics Guide.
      73a9f640
  5. 06 7月, 2018 4 次提交
  6. 05 7月, 2018 11 次提交