Topic: Apartment Gem
I've written a large multi-tenant medical app in PHP. After 5 years it is virtually impossible to maintain, so I am re-writing it in rails. My learning curve with rails has been slow to say the least, as I have worked only with procedural languages. I cannot go through another tutorial, I have to just dive in and start doing it before anything is going to stick. Anyway, I was very happy to find the Apartment gem and start testing. I've hit a road block, and I know it's me. The docs make it look way too simple and after 2 days of google searches I'm not getting anywhere.
Here's the gem -> https://github.com/bradrobertson/apartment
I put the following in /config/initializers/apartment.rb
Apartment.configure do |config|
config.database_names = lambda{ Customer.select(:database_name).map(&:database_name) }
end
When I run rake apartment:migrate I get:
rake aborted!
uninitialized constant Customer
I tried changing Customer above to my app name 'Testapp' and I get:
rake aborted!
private method 'select' called for Testapp:Module
Any help or direction I'd really appreciate it. I'm sure in a few months I realize how ridiculously simple my question is, but for now I'm stuck.