Class: HhClickHouseRestaurant

Inherits:
HhClickHouseBookingBase show all
Defined in:
app/models/hh_click_house_restaurant.rb

Overview

HhClickHouseRestaurant is an exact replica of the primary Restaurant model This model provides read-only access to restaurant data stored in ClickHouse for analytical and reporting purposes. All associations and scopes mirror the primary Restaurant model to maintain consistency.

Data is synced from booking_production RDS to ClickHouse via Airbyte.

Instance Method Summary collapse

Methods inherited from HhClickHouseBookingBase

find

Instance Method Details

#active_and_not_expired?Boolean

Methods needed by the workers (mirroring Restaurant model)

Returns:

  • (Boolean)


32
33
34
# File 'app/models/hh_click_house_restaurant.rb', line 32

def active_and_not_expired?
  active? && (expiry_date.nil? || expiry_date >= Date.current)
end

#readonly?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/models/hh_click_house_restaurant.rb', line 12

def readonly?
  true
end