I have two models in the modesl directory, say ABC.rb and DEF.rb ABC.rb: class AbcClass < ActiveRecord::Base ...... hello = Hash.new() hello = DefClass.new #<---here is the error occur ...... DEF.rb: class DefClass < ActiveRecord::Base ...... .... Do I missing anything important to create the instance?? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ianne Leson wrote:> I have two models in the modesl directory, say ABC.rb and DEF.rb > > ABC.rb: > class AbcClass < ActiveRecord::Base > ...... > hello = Hash.new() > hello = DefClass.new #<---here is the error occur > ...... > > > DEF.rb: > class DefClass < ActiveRecord::Base > ...... > .... > > Do I missing anything important to create the instance?? Thanks > > -- > Posted via http://www.ruby-forum.com/.Yes, Rails expects the name of the model file to be ''def_class.rb'' or ''abc_class.rb''. _Kevin --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
_Kevin wrote:> Ianne Leson wrote: >> DEF.rb: >> class DefClass < ActiveRecord::Base >> ...... >> .... >> >> Do I missing anything important to create the instance?? Thanks >> >> -- >> Posted via http://www.ruby-forum.com/. > > Yes, Rails expects the name of the model file to be ''def_class.rb'' or > ''abc_class.rb''. > > _Kevinsorry for my incorrect example, yes, indeed I have followed the rules of "abc_class.rb for AbcClass instance" Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ianne Leson wrote:> _Kevin wrote: > > Ianne Leson wrote: > >> DEF.rb: > >> class DefClass < ActiveRecord::Base > >> ...... > >> .... > >> > >> Do I missing anything important to create the instance?? Thanks > >> > >> -- > >> Posted via http://www.ruby-forum.com/. > > > > Yes, Rails expects the name of the model file to be ''def_class.rb'' or > > ''abc_class.rb''. > > > > _Kevin > > sorry for my incorrect example, yes, indeed I have followed the rules > of "abc_class.rb for AbcClass instance" > > Thanks. > > -- > Posted via http://www.ruby-forum.com/.And what error are you getting? _Kevin --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- how to get the message from validates_presence_of
- [LLVMdev] Machine LICM and cheap instructions?
- transactions not work for array?
- Trying to use ActiveRecord STI but fails
- [LLVMdev] Questions about attaching DWARF source code debugging information to generated LLVM-IR.