Skip to content

Commit b4f51dd

Browse files
committed
Stop caching as fields are defined progressively
During the document's class definition.
1 parent 8856150 commit b4f51dd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/active_admin/mongoid/document.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ module ActiveAdmin::Mongoid::Document
55
extend ActiveSupport::Concern
66

77

8-
9-
108
# INSTANCE METHODS
119

1210
# Returns the column object for the named attribute.
@@ -90,7 +88,8 @@ def cache
9088
# Columns
9189

9290
def content_columns
93-
@content_columns ||= fields.map(&:second).reject do |f|
91+
# cannot cache this, since changes in time (while defining fields)
92+
fields.map(&:second).reject do |f|
9493
f.name =~ /(^_|^(created|updated)_at)/ or Mongoid::Fields::ForeignKey === f
9594
end
9695
end

0 commit comments

Comments
 (0)