Skip to content

Commit

Permalink
Update ranked-model.rb
Browse files Browse the repository at this point in the history
Raising the NonNilColumnDefault exception causes the Rails app to not even boot.  Allow users to react to this requirement without crashing their application after adding the gem.
  • Loading branch information
vanboom authored Oct 8, 2021
1 parent c8ebb37 commit 6265cdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ranked-model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def ranks *args
ranker = RankedModel::Ranker.new(*args)

if column_default(ranker)
raise NonNilColumnDefault, %Q{Your ranked model column "#{ranker.name}" must not have a default value in the database.}
Rails.logger.fatal NonNilColumnDefault, %Q{Your ranked model column "#{ranker.name}" must not have a default value in the database.}
end

self.rankers << ranker
Expand Down

0 comments on commit 6265cdb

Please sign in to comment.