Skip to content

Instantly share code, notes, and snippets.

@iHiD
Created May 26, 2011 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iHiD/993158 to your computer and use it in GitHub Desktop.
Save iHiD/993158 to your computer and use it in GitHub Desktop.
Table Name Bug in Rails 3
# config/application.rb
#...
config.autoload_paths += %W(#{config.root}/app/models/namespaces)
#...
# app/models/namespaces/exam_room.rb
module ExamRoom
def self.table_name_prefix
'exam_room_'
end
end
# app/models/namespaces/exam_room_practice.rb
module ExamRoom::Practice
def self.table_name_prefix
'exam_room_practice_'
end
end
# app/models/exam_room/practice/question.rb
class ExamRoom::Practice::Question < ActiveRecord::Base
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment