-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: railsmdb
-
None
The following happens with both railsmdb and rails, when ActiveRecord is not included:
railsmdb generate model Score name:string value:number /Users/alex/.rvm/gems/ruby-3.1.2/gems/railties-7.0.8/lib/rails/generators/generated_attribute.rb:65:in `valid_type?': uninitialized constant #<Class:Rails::Generators::GeneratedAttribute>::ActiveRecord (NameError) ActiveRecord::Base.connection.valid_type?(type) ^^^^^^^^^^^^ from /Users/alex/.rvm/gems/ruby-3.1.2/gems/railties-7.0.8/lib/rails/generators/generated_attribute.rb:46:in `parse' from /Users/alex/.rvm/gems/ruby-3.1.2/gems/railties-7.0.8/lib/rails/generators/named_base.rb:184:in `block in parse_attributes!' from /Users/alex/.rvm/gems/ruby-3.1.2/gems/railties-7.0.8/lib/rails/generators/named_base.rb:183:in `map' from /Users/alex/.rvm/gems/ruby-3.1.2/gems/railties-7.0.8/lib/rails/generators/named_base.rb:183:in `parse_attributes!' from /Users/alex/.rvm/gems/ruby-3.1.2/gems/railties-7.0.8/lib/rails/generators/named_base.rb:17:in `initialize' from /Users/alex/.rvm/gems/ruby-3.1.2/gems/thor-1.2.2/lib/thor/group.rb:226:in `new' from /Users/alex/.rvm/gems/ruby-3.1.2/gems/thor-1.2.2/lib/thor/group.rb:226:in `dispatch' from /Users/alex/.rvm/gems/ruby-3.1.2/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
With railsmdb at least, we might be able to fix this by adding an alias for types like "number". More generally, it would be good to recognize when an unsupported type is given.
- links to