Sha256: 1ece208161c6e580760b815c7508d842f79c6c80910db5a2adca28998b9af1c4

Contents?: true

Size: 447 Bytes

Versions: 24

Compression:

Stored size: 447 Bytes

Contents

class Wco::Api::ObfuscatedRedirectsController < Wco::ApiController

  skip_before_action :decode_jwt

  def show
    @obf = Wco::ObfuscatedRedirect.find params[:id]
    # puts! @obf, '@obf'
    authorize! :show, @obf

    visit_time = Time.now
    @obf.update_attributes({
      visited_at: visit_time,
      visits:    @obf.visits + [ visit_time ],
    })

    if DEBUG
      render and return
    end

    redirect_to @obf.to_link
  end

end


Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
wco_models-3.1.0.187 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.184 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.183 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.182 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.181 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.180 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.178 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.177 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.176 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.175 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.174 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.173 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.172 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.171 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.170 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.169 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.168 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.167 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.166 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.165 app/controllers/wco/api/obfuscated_redirects_controller.rb