I have this code:
module Helper
def translates(*attributes)
attributes.each do |attribute|
define_method("find_by_#{attribute}") do |value|
value
end
end
end
end
class SomeClass
extend Helper
translates :foo
end
Now, in my opinion, the method SomeClass.find_by_foo
should exist. But it doesn't. Do you know what am I doing wrong?