Only cache attributes for ActiveRecord objects

Replace hardcoded "IDC:" namespace references in test cases with
embedded Ruby expression.