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-0.8.1 lib/hobo/dev_controller.rb
hobo-0.8.2 lib/hobo/dev_controller.rb
hobo-0.8.3 lib/hobo/dev_controller.rb
hobo-0.8.4 lib/hobo/dev_controller.rb
hobo-0.8.5 lib/hobo/dev_controller.rb
hobo-0.8.7 lib/hobo/dev_controller.rb
hobo-0.8.6 lib/hobo/dev_controller.rb
hobo-0.8 lib/hobo/dev_controller.rb