discourse-solved/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js

21 lines
438 B
JavaScript
Raw Normal View History

2018-10-22 14:49:33 -04:00
import Category from "discourse/models/category";
export default {
2018-10-22 14:49:33 -04:00
name: "extend-category-for-solved",
2018-10-22 14:49:33 -04:00
before: "inject-discourse-objects",
initialize() {
Category.reopen({
enable_accepted_answers: Ember.computed(
"custom_fields.enable_accepted_answers",
{
get(fieldName) {
return Ember.get(this.custom_fields, fieldName) === "true";
2020-09-04 07:22:22 -04:00
},
}
2020-09-04 07:22:22 -04:00
),
});
2020-09-04 07:22:22 -04:00
},
};