Class: Appearance

Inherits:
ApplicationRecord show all
Includes:
CacheMarkdownField, CacheableAttributes, ObjectStorage::BackgroundMove, WithUploads
Defined in:
app/models/appearance.rb

Constant Summary

Constants included from WithUploads

WithUploads::FILE_UPLOADERS

Constants included from CacheMarkdownField

CacheMarkdownField::INVALIDATED_BY

Class Method Summary collapse

Instance Method Summary collapse

Methods included from WithUploads

#retrieve_upload

Methods included from FastDestroyAll::Helpers

#perform_fast_destroy

Methods included from AfterCommitQueue

#run_after_commit, #run_after_commit_or_now

Methods included from ObjectStorage::BackgroundMove

#background_upload, #changed_mounts

Methods included from CacheMarkdownField

#attribute_invalidated?, #banzai_render_context, #cached_html_for, #cached_html_up_to_date?, #can_cache_field?, #invalidated_markdown_cache?, #latest_cached_markdown_version, #local_version, #parent_user, #refresh_markdown_cache, #refresh_markdown_cache!, #rendered_field_content, #skip_project_check?, #updated_cached_html_for

Methods included from CacheableAttributes

#cache!

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.current_without_cacheObject

Overrides CacheableAttributes.current_without_cache


38
39
40
# File 'app/models/appearance.rb', line 38

def self.current_without_cache
  first
end

Instance Method Details

#favicon_pathObject


56
57
58
# File 'app/models/appearance.rb', line 56

def favicon_path
  logo_system_path(favicon, 'favicon')
end

#header_logo_pathObject


52
53
54
# File 'app/models/appearance.rb', line 52

def header_logo_path
  logo_system_path(, 'header_logo')
end

#logo_pathObject


48
49
50
# File 'app/models/appearance.rb', line 48

def logo_path
  logo_system_path(, 'logo')
end

#show_footer?Boolean

Returns:

  • (Boolean)

64
65
66
# File 'app/models/appearance.rb', line 64

def show_footer?
  footer_message.present?
end

#show_header?Boolean

Returns:

  • (Boolean)

60
61
62
# File 'app/models/appearance.rb', line 60

def show_header?
  header_message.present?
end

#single_appearance_rowObject


42
43
44
45
46
# File 'app/models/appearance.rb', line 42

def single_appearance_row
  if self.class.any?
    errors.add(:base, _('Only 1 appearances row can exist'))
  end
end