Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: thoughtbot/factory_bot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.3.0
Choose a base ref
...
head repository: thoughtbot/factory_bot
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.4.0
Choose a head ref
  • 4 commits
  • 23 files changed
  • 4 contributors

Commits on Sep 1, 2023

  1. Document integration with 2.7 and 3.0 syntactic sugars (#1592)

    Ruby 2.7 introduced [numbered block parameters][], and 3.0 introduced
    [Hash literal value omission][], so document how they integrate with
    Factory Bot.
    
    [numbered block parameters]: https://ruby-doc.org/core-2.7.1/Proc.html#class-Proc-label-Numbered+parameters
    [Hash literal value omission]: https://docs.ruby-lang.org/en/3.1/syntax/literals_rdoc.html#label-Hash+Literals
    seanpdoyle authored Sep 1, 2023
    Configuration menu
    Copy the full SHA
    8f4f899 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2023

  1. Support uuid primary keys in build_stubbed

    fixes #1498
    closes #1514
    
    Co-authored-by: Alexandre Ruban <alexandre@hey.com>
    2 people authored and mike-burns committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    9b9b24f View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2023

  1. Pass block to expect as needed

    RSpec's `expect` has two forms:
    
    - scalar: `expect(result).to be_truthy`
    - block: `expect { thunk }.not_to raise_error(RuntimeError)`
    
    So what happens when you mix them?
    
    ```ruby
    thunk = -> { 1 / 0 }
    expect(thunk).not_to raise_error(RuntimeError)
    ```
    
    If you do that, RSpec complains:
    
    > The implicit block expectation syntax is deprecated, you should pass a
    > block rather than an argument to `expect` to use the provided block
    > expectation matcher or the matcher must implement
    > `supports_value_expectations?`
    
    The easy solution is to pass the Proc as a block, using `&`:
    
    ```
    thunk = -> { 1 / 0 }
    expect(&thunk).not_to raise_error(RuntimeError)
    ```
    mike-burns committed Nov 17, 2023
    Configuration menu
    Copy the full SHA
    388f93f View commit details
    Browse the repository at this point in the history
  2. Bump to 6.4.0 [ci skip]

    * Added: if `build_stubbed` detects a UUID primary key, generate the correct
      type (Peter Boling, Alexandre Ruban).
    * Docs: show examples of Ruby 3 syntactic sugars (Sean Doyle).
    * Internal: resolve test warning messages (Mike Burns).
    mike-burns committed Nov 17, 2023
    Configuration menu
    Copy the full SHA
    12f246d View commit details
    Browse the repository at this point in the history
Loading