rubycas / rubycas-client-rails

Rails plugin for the RubyCAS-Client
MIT License
77 stars 70 forks source link

uninitialized constant RubyCAS::GatewayFilter #4

Closed robertpyke closed 12 years ago

robertpyke commented 13 years ago

When trying to use the code before_filter RubyCAS::GatewayFilter

I get the following error: uninitialized constant RubyCAS::GatewayFilter

I think is because the GatewayFilter is incorrectly nested.

I believe that the Filter class isn't closed (ended) until after the GatewayFilter is defined. i.e. the GatewayFilter is an inner class of Filter.

A better way of me showing this is to look at the code at the bottom of the rubycas-client-rails.rb file:

      class GatewayFilter < Filter        #(start the GatewayFilter class)
        def self.use_gatewaying?        #(start the use_gatewaying? method)
          return true unless @@config[:use_gatewaying] == false
        end                                               #(end the use_gatewaying? method)
      end                                                 #(end GatewayFilter class)
    end                                                   #(end Filter class) 
 end                                                     #(end the module RubyCAS)

The code that looks like it closing the Filter class, is actually closing the "class << self" code within Filter.

robertpyke commented 13 years ago

I should add that I modified my local copy of this gem based on what I mentioned above, and it fixed the problem for me.

pho3nixf1re commented 13 years ago

same problem here. solution in pull request https://github.com/rubycas/rubycas-client-rails/pull/5

zuk commented 12 years ago

pull request 5 is in