0

So I am trying to use the rails3 branch of Nifty Generators by Ryan Bates. Now I've used this gem before with beta1 and its worked, but after upgrading to beta2 I've been getting a very wierd error.

lib/generators/nifty/scaffold/scaffold_generator.rb:35:in `block in initialize': uninitialized constant Rails::Generators::GeneratedAttribute (NameError)

The peice of code where this happens:

args_for_c_m.each do |arg|
  if arg == '!'
    options[:invert] = true
  elsif arg.include?(':')
    @model_attributes << Rails::Generators::GeneratedAttribute.new(*arg.split(':'))
  else
    @controller_actions << arg
    @controller_actions << 'create' if arg == 'new'
    @controller_actions << 'update' if arg == 'edit'
  end
end

Now I've seen GeneratedAttribute used in many gems before, so I'm confused on why its breaking. I'm not sure, but I think this has to do with beta2.

So my question is this a Rails problem of something on my end? If it is on my end any ideas what I have may done wrong?

Thank you.

1 Answer 1

1

Probably either a beta2 bug or rails doesn't load that module automatically anymore. Try adding

require 'rails/generators/generated_attribute'
1
  • I went to the rails console and did a quick "require 'rails/generators/generated_attribute'", it returned nil. So I don't think this will work either. Apr 7, 2010 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.