Ruby on Rails Sunday, January 22, 2012

Hello everybody...

i was trying update my application from 2.3.5 (yes... i know, very
old) to 3.2.

as we know, many changes occurred during that time and i don't know if
this ploblem is a know problem or other rule of pluralization... well
i really don't know how to solve this.

two models

Class Department < ActiveRecord::Base
...
has_many :waves
...
end

Class Wave < ActiveRecord::Base
...
belongs_to :department
...
end

Department.find(x).waves

explode this...

uninitialized constant Department::Wafe

/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/gems/
activerecord-3.2.0/lib/active_record/inheritance.rb:119:in
`compute_type'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/activerecord-3.2.0/lib/active_record/reflection.rb:172:in `klass'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/activerecord-3.2.0/lib/active_record/associations/association.rb:
117:in `klass'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/activerecord-3.2.0/lib/active_record/associations/association.rb:
165:in `find_target?'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/activerecord-3.2.0/lib/active_record/associations/
collection_association.rb:332:in `load_target'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/activerecord-3.2.0/lib/active_record/associations/
collection_proxy.rb:44:in `load_target'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/activerecord-3.2.0/lib/active_record/associations/
collection_proxy.rb:88:in `method_missing'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/formatter.rb:87:in `block in
determine_output_class'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/formatter.rb:87:in `each'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/formatter.rb:87:in `any?'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/formatter.rb:87:in `determine_output_class'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/formatter.rb:53:in `format_output'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/view.rb:204:in `render_output'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/view.rb:123:in `view_output'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/view.rb:200:in `view_or_page_output'
/Users/murilomonteiro/.rvm/gems/ruby-1.9.3-p0@TalentTracker3.2/
gems/hirb-0.6.0/lib/hirb/view.rb:186:in `output_value'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/
irb.rb:160:in `block (2 levels) in eval_input'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/
irb.rb:273:in `signal_status'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/
irb.rb:156:in `block in eval_input'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/
ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/
ruby-lex.rb:229:in `loop'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/
ruby-lex.rb:229:in `block in each_top_level_statement'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/
ruby-lex.rb:228:in `catch'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/
ruby-lex.rb:228:in `each_top_level_statement'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/
irb.rb:155:in `eval_input'
/Users/murilomonteiro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/
irb.rb:70:in `block in start'

i can find Wave.find(x).department.

why of this? uninitialized constant Department::Wafe

Thanks in advance for answers...

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment