i have a function that i wanna use in different models and i wanna do it
DRY.
so my best option as i see it is to include a module i made (that is in the
lib/ directory) in the model.
my code basicly looks something like this (for testing purpose, i didn't
implement my function yet)
lib/model_helper.rb
module ModelHelper
  def bla
    puts "hello world"
  end
end

app/models/test.rb
class Test < ActiveRecord::Base
   include ModelHelper
end

now the weird part is, when i try to do this in rails 2.2 it works but when
trying to do this in rails 3.0.0 it doesnt.

why is that?
is there any way of doing it in the newest version of rails?

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to