Skip to content
This repository

Error while trying to generate AccessToken model #52

Open
spinlock99 opened this Issue March 30, 2011 · 2 comments

2 participants

Andrew Dixon Ryan Muller
Andrew Dixon

Sorry for the cross-post (I put this issue on the example project as well). Please let me know which project this is more appropriate in and I'll delete the other one.

I'm running rails 3.0.5 on ruby 1.9.2 and when I try to generate a model for the AccessToken I get the following error:

$ rails generate model AccessToken user_id:integer type:string key:string token:string
secret:string active:boolean
invoke active_record
The name 'AccessToken' is either already used in your application or reserved by Ruby on
Rails. Please choose an alternative and run this generator again.

I'll try hand coding the migration to add the table to the database but I'm concerned that AccessToken may be a rails reserved key word and I'll run into trouble down the line. Any help understanding what is going on here would be greatly appreciated.

Thanks!

Andrew Dixon

OK, I changed that line to $rails generate model AccessTokens ... with an "s" on the end and all is well. I'd still like to learn more about AccessTokens if anyone is willing to provide a few links to the documentation :)

Thanks.

Ryan Muller

I might be wrong, but I think AccessToken is already a model in one of the dependencies, so you only need to create the migration and not the model itself. In the authlogic-connect-example you can see that there is no AccessToken model. If this is the case, your solution works only because the pluralized AccessTokens model is never accessed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.