Skip to content

Commit

Permalink
Make factory_bot_rails allow sequences on PKs
Browse files Browse the repository at this point in the history
Starting with version 6.3.0, factory_bot_rails rejects sequence definitions for Active Record primary keys unless this config option is set.
  • Loading branch information
robinjam committed Nov 28, 2023
1 parent 29b4eff commit d3bf1b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@ class Application < Rails::Application

# Support for inversing belongs_to -> has_many Active Record associations.
config.active_record.has_many_inversing = false

# See https://github.com/thoughtbot/factory_bot_rails#active-record-configuration
# Required because we define a sequence on Dimensions::Date#date, which is a primary key
config.factory_bot.reject_primary_key_attributes = false
end
end

0 comments on commit d3bf1b0

Please sign in to comment.