preload category custom fields
This commit is contained in:
parent
c857e020a2
commit
b7ee6a1b25
15
plugin.rb
15
plugin.rb
|
@ -115,6 +115,21 @@ after_initialize do
|
|||
end
|
||||
end
|
||||
|
||||
[
|
||||
'donations_cause',
|
||||
'donations_total',
|
||||
'donations_month',
|
||||
'donations_backers',
|
||||
'donations_show_amounts',
|
||||
'donations_maintainers',
|
||||
'donations_maintainers_label',
|
||||
'donations_github',
|
||||
'donations_meta'
|
||||
].each do |key|
|
||||
Site.preloaded_category_custom_fields << key if Site.respond_to? :preloaded_category_custom_fields
|
||||
end
|
||||
|
||||
|
||||
add_to_serializer(:basic_category, :donations_cause) { object.donations_cause }
|
||||
add_to_serializer(:basic_category, :donations_total) { object.donations_total }
|
||||
add_to_serializer(:basic_category, :include_donations_total?) { object.donations_show_amounts }
|
||||
|
|
Loading…
Reference in New Issue