Skip to content

Commit 730633b

Browse files
committed
Add test for Schema
We need to create the db table for FlipFlop feature flagging. (We add the `Flipflop.show_all_content_block_types?` back in to the `Schema` model now we understand that the dependency on FlipFlop is deep.)
1 parent 9c3e2dd commit 730633b

4 files changed

Lines changed: 435 additions & 2 deletions

File tree

app/models/content_block_manager/content_block/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Schema
1010

1111
class << self
1212
def valid_schemas
13-
VALID_SCHEMAS
13+
Flipflop.show_all_content_block_types? ? VALID_SCHEMAS : %w[pension]
1414
end
1515

1616
def all
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class CreateFlipflopFeatures < ActiveRecord::Migration[8.0]
2+
def change
3+
create_table :flipflop_features do |t|
4+
t.text :key, null: false
5+
t.boolean :enabled, null: false, default: false
6+
7+
t.timestamps
8+
end
9+
add_index :flipflop_features, :key
10+
end
11+
end

db/schema.rb

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)