Module: RatingUrlHelper Deprecated

Extended by:
ActiveSupport::Concern
Included in:
NotificationService::Sms, ReservationCpt::Serializers::ProfileSerializer, UserMailer
Defined in:
app/helpers/rating_url_helper.rb

Overview

Deprecated.

This helper is deprecated. Use RatingUrlService instead. This module now acts as a compatibility shim, delegating to RatingUrlService. It will be removed in a future version.

Note:

This module is included in controllers and mailers where rating URLs are needed

Helper module for generating rating/review URLs for both signed users and guests

Examples:

Migration from helper to service

# Old way (helper)
include RatingUrlHelper
url = rating_url_for(reservation, rate: 5)

# New way (service)
service = RatingUrlService.new(reservation)
url = service.url_for(rate: 5)

See Also:

Instance Method Summary collapse

Instance Method Details

#guest_rating_url(reservation, rate: nil, only_path: true) ⇒ String

Deprecated.

Use RatingUrlService.new(reservation).guest_url instead

Generates a rating URL for a guest (non-signed user)

Examples:

guest_rating_url(reservation, rate: 5)
# => "/reservations/rating/abc123def456?rate=5"

Parameters:

  • reservation (Reservation)

    The reservation object

  • rate (Integer, nil) (defaults to: nil)

    The rating value (1-5 stars), optional

  • only_path (Boolean) (defaults to: true)

    Whether to return only the path or full URL (default: true)

Returns:

  • (String)

    The rating URL for the guest



43
44
45
# File 'app/helpers/rating_url_helper.rb', line 43

def guest_rating_url(reservation, rate: nil, only_path: true)
  RatingUrlService.new(reservation).guest_url(rate: rate, only_path: only_path)
end

#rating_url_for(reservation, rate: nil) ⇒ String

Deprecated.

Use RatingUrlService.new(reservation).url_for instead

Generates the appropriate rating URL based on user type

Examples:

rating_url_for(reservation, rate: 4)
# => "/reservations/rating/abc123def456?rate=4"

Parameters:

  • reservation (Reservation)

    The reservation object

  • rate (Integer, nil) (defaults to: nil)

    The rating value (only used for guests)

Returns:

  • (String)

    The appropriate rating URL



58
59
60
# File 'app/helpers/rating_url_helper.rb', line 58

def rating_url_for(reservation, rate: nil)
  RatingUrlService.new(reservation).url_for(rate: rate)
end