Sha256: 330d4114223ff812a84b04072d1b1d57b6ee91af2d4401682f04801ee7925f0e

Contents?: true

Size: 751 Bytes

Versions: 1

Compression:

Stored size: 751 Bytes

Contents

if Auth.generate_routes?
  ActionController::Routing::Routes.draw do |map|
    Auth.configuration.authenticated_models.each do |model|
      catch :missing do
        begin
          model.name # if an error is going to occur due to missing model, it'll happen here.
        rescue NameError
          # we rescue silently because the user's already been warned.
          throw :missing
        end

        map.resource model.name.underscore, :controller => model.accounts_controller,
                                            :requirements => { :model => model.name } do |model_res|
          model_res.resource :session, :controller => model.sessions_controller, :requirements => { :model => model.name }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sparkly-auth-1.0.0 rails/routes.rb