Been spending the whole day trying to fix this deprecation warning in my Rails project:
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in Mongoid::Document instead. (called from include at /Users/kmandrup/test_model/app/models/user.rb:2)
I finally tracked it down to an issue with the ActsAsGmappable module implementation. I changed it to use the following convention and now the deprecation warning disappears for all my models :)
Also this refactoring is a much better convention than the "old style"...
module Gmaps4rails
module ActsAsGmappable
extend ActiveSupport::Concern
# This is a validation method which triggers the geocoding and save its results
def process_geocoding
Gmaps4rails::ModelHandler.new(self, gmaps4rails_options).retrieve_coordinates
end
# creates json for one instance
def to_gmaps4rails(&block)
json = "["
object_json = Gmaps4rails.create_json(self, &block)
json << object_json.to_s unless object_json.nil?
json << "]"
end
module ClassMethods
...
end
end
Been spending the whole day trying to fix this deprecation warning in my Rails project:
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in Mongoid::Document instead. (called from include at /Users/kmandrup/test_model/app/models/user.rb:2)
I finally tracked it down to an issue with the
ActsAsGmappable
module implementation. I changed it to use the following convention and now the deprecation warning disappears for all my models :)Also this refactoring is a much better convention than the "old style"...
So please make this fix ;)