We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc5577c commit 9d66563Copy full SHA for 9d66563
lib/active_admin/views/components/attributes_table.rb
@@ -56,7 +56,13 @@ def content_for(attr)
56
end
57
58
def find_attr_value(attr)
59
- attr.is_a?(Proc) ? attr.call(@record) : @record.send(attr.to_s.gsub(/_id\z/,''))
+ if attr.is_a?(Proc)
60
+ attr.call(@record)
61
+ elsif attr.to_s[/\A(.+)_id\z/] && @record.respond_to?($1.to_sym)
62
+ @record.send($1.to_sym)
63
+ else
64
+ @record.send(attr.to_sym)
65
+ end
66
67
68
0 commit comments