Skip to content

Commit

Permalink
fix: don't allow users to set demo-pro.maglev.dev as the domain of th…
Browse files Browse the repository at this point in the history
…eir site
  • Loading branch information
did committed Apr 3, 2024
1 parent cbac31a commit fbc1c72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ class Site < ApplicationRecord

## validations ##
validates :name, presence: true
validates :domain, uniqueness: { allow_nil: true }
validates :domain,
uniqueness: { allow_nil: true },
exclusion: {
in: [SiteBuilderDemo::Application.config.x.main_host]
}
validates :theme_id, presence: true, on: :create

## virtual attributes ##
Expand Down

0 comments on commit fbc1c72

Please sign in to comment.