Skip to content

Commit

Permalink
choore: Change values to attribute_values in custom attributes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
muhsin-k committed Nov 18, 2021
1 parent a3ba8f9 commit bf96e8b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
Expand Up @@ -39,7 +39,7 @@ def permitted_payload
:attribute_display_type,
:attribute_key,
:attribute_model,
:default_value
attribute_values: []
)
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/custom_attribute_definition.rb
Expand Up @@ -8,8 +8,8 @@
# attribute_display_type :integer default("text")
# attribute_key :string
# attribute_model :integer default("conversation_attribute")
# attribute_values :jsonb
# default_value :integer
# values :jsonb
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint
Expand Down
Expand Up @@ -3,6 +3,7 @@ json.attribute_display_name resource.attribute_display_name
json.attribute_display_type resource.attribute_display_type
json.attribute_description resource.attribute_description
json.attribute_key resource.attribute_key
json.attribute_values resource.attribute_values
json.attribute_model resource.attribute_model
json.default_value resource.default_value
json.created_at resource.created_at
Expand Down
@@ -0,0 +1,5 @@
class ChangeValuesToAttributeValuesInCustomAttributeDefinitions < ActiveRecord::Migration[6.1]
def change
rename_column :custom_attribute_definitions, :values, :attribute_values
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_11_16_131740) do
ActiveRecord::Schema.define(version: 2021_11_18_100301) do

# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
Expand Down Expand Up @@ -355,7 +355,7 @@
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.text "attribute_description"
t.jsonb "values", default: []
t.jsonb "attribute_values", default: []
t.index ["account_id"], name: "index_custom_attribute_definitions_on_account_id"
t.index ["attribute_key", "attribute_model"], name: "attribute_key_model_index", unique: true
end
Expand Down

0 comments on commit bf96e8b

Please sign in to comment.