pelle / oauth-plugin

Rails plugin for OAuth
http://stakeventures.com/articles/2009/07/21/consuming-oauth-intelligently-in-rails
MIT License
715 stars 215 forks source link

Error when invoking oauth_provider generator #113

Open ghost opened 12 years ago

ghost commented 12 years ago

Using Rails 3.2.2. When attempting to generate an oauth_provider, I get the following error:

$ rails g oauth_provider

/gems/railties-3.2.2/lib/rails/generators/named_base.rb:156:in parse_attributes!': undefined methodattributes=' for #OauthProviderGenerator:0x000000060441f0 (NoMethodError)

I solved it by modifying named_base.rb:

Convert attributes array into GeneratedAttribute objects.

    def parse_attributes! #:nodoc:
      if self.respond_to?(:attributes=)    # Added this IF statement
        self.attributes = (attributes || []).map do |attr|
          Rails::Generators::GeneratedAttribute.parse(attr)
        end
      end
    end

I'm not sure whether this is an issue for the oauth_plugin or for the Rails team.

Just thought I'd show you how I solved the problem.

Cheers, Jim