Class: ThemeSetting
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ThemeSetting
- Defined in:
- app/models/theme_setting.rb
Constant Summary collapse
- TYPES_ENUM =
Enum.new(integer: 0, float: 1, string: 2, bool: 3, list: 4, enum: 5, upload: 6, objects: 7)
- MAXIMUM_JSON_VALUE_SIZE_BYTES =
0.5 MB
0.5 * 1024 * 1024
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.guess_type(value) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/models/theme_setting.rb', line 43 def self.guess_type(value) case value when Integer types[:integer] when Float types[:float] when String types[:string] when TrueClass, FalseClass types[:bool] end end |
.types ⇒ Object
39 40 41 |
# File 'app/models/theme_setting.rb', line 39 def self.types TYPES_ENUM end |
Instance Method Details
#clear_settings_cache ⇒ Object
34 35 36 37 |
# File 'app/models/theme_setting.rb', line 34 def clear_settings_cache # All necessary caches will be cleared on next ensure_baked! theme.settings_field&.invalidate_baked! end |