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",
|
|
|
|
{
|
2019-10-23 09:37:37 -04:00
|
|
|
get(fieldName) {
|
|
|
|
return Ember.get(this.custom_fields, fieldName) === "true";
|
2020-09-04 07:22:22 -04:00
|
|
|
},
|
2015-09-17 12:21:41 -04:00
|
|
|
}
|
2020-09-04 07:22:22 -04:00
|
|
|
),
|
2015-09-17 12:21:41 -04:00
|
|
|
});
|
2020-09-04 07:22:22 -04:00
|
|
|
},
|
2015-09-17 12:21:41 -04:00
|
|
|
};
|