Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails (3.1.3) scaffolding is completely broken by enumerated_attribute #42

Open
jpwynn opened this issue Jan 28, 2012 · 6 comments
Open

Comments

@jpwynn
Copy link

jpwynn commented Jan 28, 2012

if enumerated_attribute is in Gemfile, 'rails g scaffold Anything' breaks, with:

/Users/johndoe/.rvm/gems/ruby-1.9.2-p290/gems/enumerated_attribute-0.2.16/lib/enumerated_attribute/rails_helpers.rb:26:in `require': no such file to load -- rails_generator (LoadError)

100% repeatable.

Just to test, tried in brand new project:

rails new trythis
cd trythis
rails g scaffold ModelOne         (works fine)
           (add enumerated+attribute to Gemfile, run bundle install)
rails g scaffold ModelTwo         (throws error message above)
           (comment out enumerated_attribute in Gemfile, run bundle install)
rails g scaffold ModelThree      (works fine)
@jpwynn
Copy link
Author

jpwynn commented Jan 28, 2012

ugly as heck workaround if you need to run scaffold after adding enumerated_attribute

  1. comment out # gem 'enumerated_attribute' (save file, but don't have to run bundle install)

  2. run your rails g scaffold command

  3. replace in your Gemfile (save)

@ksz2k
Copy link

ksz2k commented Jan 30, 2012

#9
;)

@jpwynn
Copy link
Author

jpwynn commented Jan 30, 2012

Not sure that's the same bug? Though I'm relative newbie with github, so maybe I'm doing something wrong.

I did see that earlier issue and the pull request, and I thought github said it was "merged" (and the link to github.com/trollixx/enumerated_attribute.git gives a 404 error so figured that meant the patch was removed because it's in the official gem) ...

So I thought that meant it had been fixed in the current gem so that when my app's Gemfile uses the "current" gem it would incorporate that fix. However, the problem is there, now, with the current gem.

Can you tell me how to incorporate the fix, whereever it is, into my app? Thanks!

@ksz2k
Copy link

ksz2k commented Jan 31, 2012

Maybe there was no next version release since that fix..? If so, try to install enum_attr gem with git source given, eg. with gem 'enumerated_attribute', :git => 'git://github.com/jeffp/enumerated_attribute.git'

@creativetags
Copy link

gem 'enumerated_attribute', :git => 'git://github.com/jeffp/enumerated_attribute.git' fixed it for me (version 0.3.0.beta1)

@rhannequin
Copy link

Just want to warn that I just had this bug right now, which is fixed if I use git source from @ksz2k and @creativetags . Any reason why the gem is still broken if not loaded from Github ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants