Feature: Installation global config (#839) (#840)

* Renamed concern from Feature to Featurable

* Feature: Installation config (#839)
* Added new model installtion config with corresponding migrations and specs
* Created an installation config yml (key value store model)
* Created a config loader module to load the installaltion configs
* Added this to the config loader seeder
* Changed the account before create hook for default feature enabling to use the feature values from installtion config
* Renamed the feature concern to Featurable to follow the naming pattern for concerns
* Added comments and specs for modules and places that deemed necessary

* Refactored config loader to reduce cognitive complexity (#839)
This commit is contained in:
Sony Mathew
2020-05-10 22:40:36 +05:30
committed by GitHub
parent 76b98cbed4
commit 905c93b8f8
11 changed files with 203 additions and 18 deletions

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_05_09_044639) do
ActiveRecord::Schema.define(version: 2020_05_10_112339) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
@@ -246,6 +246,14 @@ ActiveRecord::Schema.define(version: 2020_05_09_044639) do
t.index ["account_id"], name: "index_inboxes_on_account_id"
end
create_table "installation_configs", force: :cascade do |t|
t.string "name", null: false
t.jsonb "serialized_value", default: "{}", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["name", "created_at"], name: "index_installation_configs_on_name_and_created_at", unique: true
end
create_table "messages", id: :serial, force: :cascade do |t|
t.text "content"
t.integer "account_id", null: false
@@ -319,20 +327,6 @@ ActiveRecord::Schema.define(version: 2020_05_09_044639) do
t.boolean "payment_source_added", default: false
end
create_table "super_admins", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["email"], name: "index_super_admins_on_email", unique: true
end
create_table "taggings", id: :serial, force: :cascade do |t|
t.integer "tag_id"
t.string "taggable_type"