Class: CustomText

Inherits:
ApplicationRecord show all
Defined in:
app/models/custom_text.rb

Overview

Used in a handful of places to provide dynamically customizable text in the web interface, such as setting the banner at the top of the page.

See Also:

  • ApplicationHelper::custom_text

Instance Method Summary collapse

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#clear_text_cache!Object

If the value of this CustomText instance was saved in cache e.g. the appication wide information box, delete it.


9
10
11
# File 'app/models/custom_text.rb', line 9

def clear_text_cache!
  Rails.cache.delete(name)
end

#nameObject


13
14
15
# File 'app/models/custom_text.rb', line 13

def name
  "#{identifier}-#{differential}"
end