1. 27 7月, 2018 8 次提交
  2. 26 7月, 2018 10 次提交
  3. 25 7月, 2018 2 次提交
  4. 24 7月, 2018 4 次提交
  5. 23 7月, 2018 2 次提交
  6. 22 7月, 2018 14 次提交
    • G
      Merge pull request #33415 from orhantoy/feature/docs-consistent-hash-syntax · 97321956
      George Claghorn 提交于
      [ci skip] Use consistent hash syntax in AR docs
      97321956
    • G
      Merge pull request #33416 from krmannix/master · 020d942b
      George Claghorn 提交于
      [ci skip] fix typo in Active Record Associations guide
      020d942b
    • G
      Merge pull request #33417 from orhantoy/feature/tidy-up-add_index-examples · e0ee147e
      George Claghorn 提交于
      [ci skip] Tidy up formatting of (consecutive) examples
      e0ee147e
    • K
      [ci skip] fix typo in Associations guide · 063003f3
      K. Rodman Mannix 提交于
      063003f3
    • R
      Merge pull request #33418 from azbshiri/document-renderer · a53a88ef
      Richard Schneeman 提交于
       [ci skip] Document render options
      a53a88ef
    • A
      Add render options in action_controller/renderer for api documentation [ci skip] · 905d848b
      Alireza Bashiri 提交于
      Complete renderer documentation
      
      Fixes #28484
      905d848b
    • O
      [ci skip] Tidy up formatting of examples · 68e209ad
      Orhan Toy 提交于
      The consecutive verbatim blocks were being merged making the output look weird.
      68e209ad
    • O
      [ci skip] Use consistent hash syntax in AR docs · 57309c75
      Orhan Toy 提交于
      The examples with `.where` uses hash w/ symbol keys so it would be more consistent to also do this with `.new`.
      Also from my experience the hash w/ symbol keys is more widely used with `where/new/create` etc. in ActiveRecord.
      57309c75
    • A
      Add implicit to path conversion to uploaded file (#28676) · 20543c04
      Aaron Kromer 提交于
      * Add implicit to path conversion to uploaded file
      
      Ruby has a few implicit conversion protocols (e.g. `to_hash`, `to_str`,
      `to_path`, etc.). These are considered implicit conversion protocols
      because in certain instances Ruby (MRI core objects) will check if an
      argument responds to the appropriate protocol and automatically convert
      it when it does; this is why you can provide a `Pathname` instance into
      `File.read` without having to explicitly call `to_s`.
      
      ```ruby
      a_file_path = 'some/path/file.ext'
      File.write a_file_path, 'String Path Content'
      File.read a_file_path
      
      a_pathname = Pathname(a_file_path)
      File.write core_file, 'Pathname Content'
      File.read a_file_path
      
      core_file = File.new(a_pathname)
      File.write core_file, 'File Content'
      File.read core_file
      
      tmp_file = Tempfile.new('example')
      File.write tmp_file, 'Tempfile Content'
      File.read tmp_file
      ```
      
      So how does an uploaded file work in such cases?
      
      ```ruby
      tmp_file = Tempfile.new('example')
      File.write tmp_file, 'Uploaded Content'
      uploaded_file = ActionDispatch::Http::UploadedFile.new(tempfile: tmp_file)
      File.read uploaded_file
      ```
      
      It fails with a `TypeError`:
      
          no implicit conversion of ActionDispatch::Http::UploadedFile into String
      
      In order to make an uploaded file work it must be explicitly converted
      to a file path using `path`.
      
      ```ruby
      File.read uploaded_file.path
      ```
      
      This requires any code that expects path/file like objects to either
      special case an uploaded file, re-implement the path conversion protocol
      to use `path`, or forces the developer to explicitly cast uploaded files
      to paths. This last option can sometimes be difficult to do when such
      calls are deep within the inner workings of libraries.
      
      Since an uploaded file already has a path it makes sense to implement
      the implicit "path" conversion protocol (just like `File` and
      `Tempfile`). This change allows uploaded file content to be treated more
      closely to regular file content, without requiring any special case
      handling or explicit conversion for common file utilities.
      
      * Note uploaded file path delegation in CHANGELOG
      20543c04
    • K
      Merge pull request #33403 from bogdanvlviv/clarify-test_notes_finds_notes_in_custom_directories · 76f22e19
      Kasper Timm Hansen 提交于
      Clarify `railties/test/application/rake/notes_test.rb`
      76f22e19
    • K
      Merge pull request #33409 from utilum/correct_epxectations_to_meet_minitest_strict_mocking · 9ca579ad
      Kasper Timm Hansen 提交于
      Use MethodCallAssertions instead of Mocha part 2
      9ca579ad
    • U
      Replace permissive Mocha expectations · 82e42c1b
      utilum 提交于
      Step 6 in #33162
      
      When using Mocha like this:
      
      `ActiveRecord::Base.expects(:establish_connection).with(some_args)`,
      
      the expectations created look something like this:
      
      ```
      @expectations=
                [#<Expectation:0x561350d968e0 expected exactly once, not yet invoked: ActiveRecord::Base.establish_connection("adapter" => "mysql2", "database" => nil) >,
                 #<Expectation:0x561350dab8f8 allowed any number of times, not yet invoked: ActiveRecord::Base.establish_connection(any_parameters) >,
                 #<Expectation:0x561350dc30c0 allowed any number of times, not yet invoked: ActiveRecord::Base.connection(any_parameters) >]
      ```
      
      Minitest mocking (and the way we use it in `MethodCallAssertions`)
      expressly refuses to facilitate such permissiive expectations, insisting
      that all calls be specified in the actual expected order.
      
      This patch replaces such calls to `Mocha#expects` with
      `ActiveSupport::Testing::MethodCallAssertions` and specifies all
      expected calls in the epxected order.
      82e42c1b
    • U
      Replace Mocha#stubs with assert_called_with · d8993750
      utilum 提交于
      A correct, but not obvious use of `ActiveSupport::Testing::MethodCallAssertions`, which might also have been part of #33337 or #33391.
      d8993750
    • U
      Fix Mocha replacement that slipped out of #33337 · a94d6ae8
      utilum 提交于
      a94d6ae8