Skip to content

Commit

Permalink
Seed task now only creates default seating zone if it doesn't already…
Browse files Browse the repository at this point in the history
… exist, making seeding idempotent again. Doesn't affect tests, since every test truncates the database anyway.
  • Loading branch information
armandofox committed Apr 16, 2024
1 parent aa7de8d commit dd7d54a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def self.create_default_account_code
end

def self.create_default_seating_zone
SeatingZone.create!(name: 'Reserved', short_name: 'res')
zone_params = {name: 'Reserved', short_name: 'res'}
SeatingZone.create!(zone_params) unless SeatingZone.find_by(zone_params)
end

def self.create_options
Expand Down

0 comments on commit dd7d54a

Please sign in to comment.