Created
June 9, 2012 07:27
-
-
Save durran/2899978 to your computer and use it in GitHub Desktop.
Custom database persistence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CustomDatabase | |
extend ActiveSupport::Concern | |
included do | |
store_in database: custom_database | |
end | |
module ClassMethods | |
def custom_database | |
# Return a string for the database name based on the globals. | |
end | |
end | |
end | |
class User | |
include Mongoid::Document | |
include CustomDatabase | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment