Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h3>{{i18n "category.post_voting_settings_heading"}}</h3>
<section class="field">
<label>
<Input id="create-as-post-voting-default" @type="checkbox" @checked={{this.category.custom_fields.create_as_qa_default}} />
<Input id="create-as-post-voting-default" @type="checkbox" @checked={{this.category.custom_fields.create_as_post_voting_default}} />
{{i18n "category.create_as_post_voting_default"}}
</label>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

class RenameSettingInCategoryCustomField < ActiveRecord::Migration[6.1]
def up
DB.exec(<<~SQL)
UPDATE category_custom_fields
SET name = 'create_as_post_voting_default'
WHERE name = 'create_as_qa_default'
SQL
end

def down
DB.exec(<<~SQL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we don't usually do this and raise an exception instead. However, It's simple enough, so I don't see why not 👍

UPDATE category_custom_fields
SET name = 'create_as_qa_default'
WHERE name = 'create_as_post_voting_default'
SQL
end
end
2 changes: 1 addition & 1 deletion lib/post_voting/engine.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module ::PostVoting
CREATE_AS_POST_VOTING_DEFAULT = "create_as_qa_default"
CREATE_AS_POST_VOTING_DEFAULT = "create_as_post_voting_default"

class Engine < Rails::Engine
engine_name 'post_voting'
Expand Down
2 changes: 1 addition & 1 deletion test/javascripts/acceptance/category-edit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ acceptance("Category Edit", function (needs) {
pretender.handledRequests[pretender.handledRequests.length - 1]
.requestBody
);
assert.ok(payload.custom_fields.create_as_qa_default);
assert.ok(payload.custom_fields.create_as_post_voting_default);
});
});