13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/intro/tours_controller.rb', line 13
def index
return render_unauthorized unless Intro.config.visible_without_signing_in || current_user
tours = Intro::Tour.with_controller_and_action(params[:controller_path], params[:action_name])
tours = tours.published
Intro.cache.write(params[:controller_path], params[:action_name], tours.any?) if Intro.config.cache
tours = filter_tours_by_route(tours)
tours = filter_tours_by_histories(tours)
tours = filter_tours_by_expired_time(tours)
tours = filter_tours_by_signed_in(tours)
render json: { data: tours.map(&:expose_attributes) }
end
|