2018-10-22 14:49:33 -04:00
|
|
|
import property from "ember-addons/ember-computed-decorators";
|
|
|
|
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",
|
|
|
|
before: "inject-discourse-objects",
|
2015-09-17 12:21:41 -04:00
|
|
|
initialize() {
|
|
|
|
Category.reopen({
|
2018-10-22 14:49:33 -04:00
|
|
|
@property("custom_fields.enable_accepted_answers")
|
2015-09-17 12:21:41 -04:00
|
|
|
enable_accepted_answers: {
|
|
|
|
get(enableField) {
|
|
|
|
return enableField === "true";
|
|
|
|
},
|
|
|
|
set(value) {
|
|
|
|
value = value ? "true" : "false";
|
|
|
|
this.set("custom_fields.enable_accepted_answers", value);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|