Platform: Mac OSX 10.6
In my terminal, i start the Ruby console with \"rails c\"
While following the Ruby on Rails 3 tutorial to build a class:
This can also happen as such:
# /models/document/geocoder.rb
class Document
module Geocoder
end
end
# /models/document.rb
require 'document/geocoder'
class Document < ActiveRecord::Base
include Geocoder
end
The require loads Document
(which has a superclass of Object) before Document < ActiveRecord::Base
(which has a different superclass).
I should note that in a Rails environment the require is not usually needed since it has auto class loading.