Skip to content

Instantly share code, notes, and snippets.

@westonplatter
Last active December 25, 2015 02:59
Show Gist options
  • Select an option

  • Save westonplatter/6907035 to your computer and use it in GitHub Desktop.

Select an option

Save westonplatter/6907035 to your computer and use it in GitHub Desktop.
# my_spree_app/config/initializers/qe.rb
module Qe
# prefix for database tables
mattr_accessor :table_name_prefix
self.table_name_prefix ||= 'qe_'
end
# my_spree_app/models/some_class.rb
class SomeClass < ActiveRecord::Base
self.table_name = "#{Qe.table_name_prefix}#{self.table_name}"
# ... model code
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment