Class: Banner

Inherits:
ApplicationRecord show all
Includes:
IdentityCache
Defined in:
app/models/banner.rb

Overview

typed: ignore frozen_string_literal: true

Constant Summary collapse

VALID_LOCATIONS =
{
  promotions_page_1: 'Promotions page above restaurant tag group',
  home_page: 'Home page as search form background',
}.freeze

Instance Method Summary collapse

Methods inherited from ApplicationRecord

sync_carrierwave_url

Instance Method Details

#fix_attributesObject



55
56
57
58
59
60
61
62
63
# File 'app/models/banner.rb', line 55

def fix_attributes
  if restaurant_tag_group_id.present?
    self.active = true
    self.locales = MyLocaleManager.available_locales
    self.order_number = 1
  end

  true
end