make `updated_at` attribute accessible in the instance model
parent
a5ce8eddb4
commit
9e9a593f5a
|
@ -3,12 +3,13 @@
|
||||||
class Instance
|
class Instance
|
||||||
include ActiveModel::Model
|
include ActiveModel::Model
|
||||||
|
|
||||||
attr_accessor :domain, :accounts_count, :domain_block
|
attr_accessor :domain, :accounts_count, :domain_block, :updated_at
|
||||||
|
|
||||||
def initialize(resource)
|
def initialize(resource)
|
||||||
@domain = resource.domain
|
@domain = resource.domain
|
||||||
@accounts_count = resource.is_a?(DomainBlock) ? nil : resource.accounts_count
|
@accounts_count = resource.is_a?(DomainBlock) ? nil : resource.accounts_count
|
||||||
@domain_block = resource.is_a?(DomainBlock) ? resource : DomainBlock.find_by(domain: domain)
|
@domain_block = resource.is_a?(DomainBlock) ? resource : DomainBlock.find_by(domain: domain)
|
||||||
|
@updated_at = resource.updated_at
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_sample_accounts
|
def cached_sample_accounts
|
||||||
|
|
Loading…
Reference in New Issue