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.164 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.163 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.162 app/controllers/wco/api/obfuscated_redirects_controller.rb
wco_models-3.1.0.161 app/controllers/wco/api/obfuscated_redirects_controller.rb