make `updated_at` attribute accessible in the instance model

staging
multiple creatures 2019-07-31 00:09:57 -05:00
parent a5ce8eddb4
commit 9e9a593f5a
1 changed files with 2 additions and 1 deletions

View File

@ -3,12 +3,13 @@
class Instance
include ActiveModel::Model
attr_accessor :domain, :accounts_count, :domain_block
attr_accessor :domain, :accounts_count, :domain_block, :updated_at
def initialize(resource)
@domain = resource.domain
@accounts_count = resource.is_a?(DomainBlock) ? nil : resource.accounts_count
@domain_block = resource.is_a?(DomainBlock) ? resource : DomainBlock.find_by(domain: domain)
@updated_at = resource.updated_at
end
def cached_sample_accounts