Sha256: 133559293f623c3d9d2673f92bfc8f6ef4a410f341a1b9e69d78e5d1091a170e

Contents?: true

Size: 773 Bytes

Versions: 28

Compression:

Stored size: 773 Bytes

Contents

class Hobo::DevController < ActionController::Base

  hobo_controller

  before_filter :developer_modes_only
  
  def set_current_user
    model = params[:model] || Hobo::User.default_user_model
    self.current_user = if params[:login]
                          model.find(:first, :conditions => {model.login_attribute => params[:login]})
                        else
                          model.find(params[:id])
                        end
    redirect_to(request.env["HTTP_REFERER"] ? :back : home_page)
  end

  private

  def developer_modes_only
    # Belt and braces. In addition to this check, the routes only get
    # defined when developer_features? is true
    render :text => "Permission Denied", :status => 403 unless Hobo.developer_features?
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hobo-1.1.0 lib/hobo/dev_controller.rb
hobo-1.0.3 lib/hobo/dev_controller.rb
hobo-1.1.0.pre4 lib/hobo/dev_controller.rb
hobo-1.1.0.pre3 lib/hobo/dev_controller.rb
hobo-1.1.0.pre2 lib/hobo/dev_controller.rb
hobo-1.1.0.pre0 lib/hobo/dev_controller.rb
hobo-1.0.2 lib/hobo/dev_controller.rb
hobo-1.0.1 lib/hobo/dev_controller.rb
hobo-1.0.0 lib/hobo/dev_controller.rb
hobo-0.9.106 lib/hobo/dev_controller.rb
hobo-0.9.105 lib/hobo/dev_controller.rb
hobo-0.9.104 lib/hobo/dev_controller.rb
hobo-0.9.103 lib/hobo/dev_controller.rb
hobo-0.9.102 lib/hobo/dev_controller.rb
hobo-0.9.101 lib/hobo/dev_controller.rb
hobo-0.9.100 lib/hobo/dev_controller.rb
hobo-0.9.0 lib/hobo/dev_controller.rb
hobo-0.8.10 lib/hobo/dev_controller.rb
hobo-0.8.9 lib/hobo/dev_controller.rb
hobo-0.8.8 lib/hobo/dev_controller.rb