Sha256: 9959753581ee3bd4c2941f2faa8574d4edc1c731a46adfb2b92fce980f0b617b
Contents?: true
Size: 1.04 KB
Versions: 12
Compression:
Stored size: 1.04 KB
Contents
require_dependency "ishapi/application_controller" module Ishapi class GalleriesController < ApplicationController # before_action :soft_check_long_term_token, only: [ :show ] before_action :check_jwt def index @galleries = Gallery.all authorize! :index, Gallery if params[:cityname] city = City.find_by :cityname => params[:cityname] @galleries = @galleries.where( :city => city ) end if params[:domain] @site = Site.find_by( :domain => params[:domain], :lang => 'en' ) @galleries = @galleries.where( :site => @site ) end @galleries = @galleries.page( params[:galleries_page] ).per( 10 ) end def show @gallery = ::Gallery.unscoped.find_by :slug => params[:slug] authorize! :show, @gallery if @gallery.premium? if @current_user&.profile&.has_premium_purchase( @gallery ) render 'show_premium_unlocked' else render 'show_premium_locked' end else render 'show' end end end end
Version data entries
12 entries across 12 versions & 1 rubygems