Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## application_controller.rb
- private
- def set_db(model, prefix)
- model_const = model.to_s.constantize
- model_const.send(:set_table_name, "#{prefix}$#{model_const}")
- end
- ## calling
- set_db :owner, session[:standort]
Add Comment
Please, Sign In to add comment