Skip to content

Commit

Permalink
Merge pull request #859 from tmaier/patch-1
Browse files Browse the repository at this point in the history
Add ActiveRecord validations to mirror table NOT NULL constraint
bkeepers authored Mar 15, 2024
2 parents 917bba2 + 1b6750a commit 4d416c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/flipper/adapters/active_record.rb
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@ class Feature < Model
].join

has_many :gates, foreign_key: "feature_key", primary_key: "key"

validates :key, presence: true
end

# Private: Do not use outside of this adapter.
@@ -30,6 +32,9 @@ class Gate < Model
"flipper_gates",
Model.table_name_suffix,
].join

validates :feature_key, presence: true
validates :key, presence: true
end

VALUE_TO_TEXT_WARNING = <<-EOS

0 comments on commit 4d416c4

Please sign in to comment.