2018-10-22 14:49:33 -04:00
|
|
|
import Category from "discourse/models/category";
|
2015-09-17 12:21:41 -04:00
|
|
|
|
|
|
|
export default {
|
2018-10-22 14:49:33 -04:00
|
|
|
name: "extend-category-for-solved",
|
2019-10-02 01:36:35 -04:00
|
|
|
|
2018-10-22 14:49:33 -04:00
|
|
|
before: "inject-discourse-objects",
|
2019-10-02 01:36:35 -04:00
|
|
|
|
2015-09-17 12:21:41 -04:00
|
|
|
initialize() {
|
|
|
|
Category.reopen({
|
2019-10-02 01:36:35 -04:00
|
|
|
enable_accepted_answers: Ember.computed(
|
|
|
|
"custom_fields.enable_accepted_answers",
|
|
|
|
{
|
|
|
|
get(enableField) {
|
|
|
|
return enableField === "true";
|
|
|
|
},
|
|
|
|
set(value) {
|
|
|
|
value = value ? "true" : "false";
|
|
|
|
this.set("custom_fields.enable_accepted_answers", value);
|
|
|
|
return value;
|
|
|
|
}
|
2015-09-17 12:21:41 -04:00
|
|
|
}
|
2019-10-02 01:36:35 -04:00
|
|
|
)
|
2015-09-17 12:21:41 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|