Hi, I have the following code in my project`s lib directory
module Pasta
module ClassMethods
def self.has_coordinates
self.send :include, InstanceMethods
end
end
module InstanceMethods
def coordinates
[longitude ||= 43.0, latitude ||= 25.0]
end
end
ActiveRecord::Base.extend ClassMethods
end
And it should create a class method for ActiveRecord::Base - has_coordinates - which I can "assign" to models... But I receive the error undefined local variable or method 'has_coordinates'
Thanks in advance!