hello is it possible to access methods I add to my models from a rake task? adding "=> :environment" seem to enable only the methods defined in ActiveRecord::Base. Calling other methods results in: undefined method `mehodname'' for ModelName --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
There''s probably something else going on. To quote: http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial#rails_models Can you access your models in a rake task? Very Yes! ;-) Are you mixing up class and instance methods? -Danimal On Apr 13, 1:03 am, eirc <eirc.e...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hello > > is it possible to access methods I add to my models from a rake task? > adding "=> :environment" seem to enable only the methods defined in > ActiveRecord::Base. Calling other methods results in: > undefined method `mehodname'' for ModelName--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
you were right, I am new to ruby so I was not correctly declaring methods thanks for pointing me to class and instance methods that knowledge seemed to do the trick On Apr 13, 4:39 pm, Danimal <fightonfightw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> There''s probably something else going on. > > To quote:http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial#rails_... > > Can you access your models in araketask? Very Yes! ;-) > > Are you mixing up class and instance methods? > > -Danimal > > On Apr 13, 1:03 am, eirc <eirc.e...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > hello > > > is it possible to access methods I add to my models from araketask? > > adding "=> :environment" seem to enable only the methods defined in > > ActiveRecord::Base. Calling other methods results in: > > undefined method `mehodname'' for ModelName--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---