Class: Locomotive::Steam::ThemeAssetRepository

Inherits:
Object
  • Object
show all
Includes:
Models::Repository
Defined in:
lib/locomotive/steam/repositories/theme_asset_repository.rb

Instance Attribute Summary

Attributes included from Models::Repository

#adapter, #local_conditions, #scope

Instance Method Summary collapse

Methods included from Models::Repository

#base_url, #build, #count, #create, #delete, #find, #first, #i18n_value_of, #inc, #initialize, #initialize_copy, #k, #last, #mapper, #prepare_conditions, #query, #update

Instance Method Details

#checksumsObject



15
16
17
18
19
20
# File 'lib/locomotive/steam/repositories/theme_asset_repository.rb', line 15

def checksums
  query { only(:checksum, :local_path) }.all.inject({}) do |memo, asset|
    memo[asset.local_path] = asset.checksum if asset.checksum
    memo
  end
end

#url_for(path) ⇒ Object



11
12
13
# File 'lib/locomotive/steam/repositories/theme_asset_repository.rb', line 11

def url_for(path)
  "#{base_url}/#{path}"
end