Class: SampleRegistrar::AssetGroupHelper

Inherits:
Object
  • Object
show all
Defined in:
app/models/sample_registrar.rb

Overview

Looks up and caches asset group names

Instance Method Summary collapse

Constructor Details

#initializeAssetGroupHelper


35
36
37
# File 'app/models/sample_registrar.rb', line 35

def initialize
  @asset_groups = Hash.new { |name_cache, name| name_cache[name] = AssetGroup.where(name: name).exists? }
end

Instance Method Details

#existing_asset_group?(name) ⇒ Boolean


39
40
41
# File 'app/models/sample_registrar.rb', line 39

def existing_asset_group?(name)
  @asset_groups[name]
end