Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Error when invoking oauth_provider generator #113

Open
ghost opened this Issue Apr 6, 2012 · 0 comments

Comments

Projects
None yet
0 participants
@ghost

ghost commented Apr 6, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment