[Ruby] HOW TO use multiple databases with ActiveRecord
Sometimes you need to access multiple databases in one application. For example, using different application’s database. But usually ActiveRecord is configured to ActiveRecord::Base directly, and so establishes a connection with ActiveRecord::Base, so you can’t use multiple database with AR. So how to do it? Just create sub-classes of ActiveRecord::Base. Sub-classes of ActiveRecord::Base can access parent class configurations and connections. So create a sub-class of ActiveRecord::Base BaseDB then set configurations to it. Create sub-classes of BaseDB then establish database connection each of them. It’s better than to set configurations and establish connection on ActiveRecord::Base directly for future. ActiveRecord::Base BaseDB <...
Learn programming tips each other
Like Ian wrote at this entry The freedom to learn new things, we’re always learning new things. It’s a really important thing working in this industry and can’t improve our products without it. Umm, let me tell you my feeling. It’s really fun, isn’t it!? Today I’ll tell you one example of what we do. We did a programming event to show everyone how you write some code. A coder writes some code. Another people watch it and ask some questions to the coder. That’s it. Quite simple. This process can help us to learn how another programmers solve problems or what kind of a productive programing environment does the coder use. The picture above is our friend’s code. He is a great programmer so we all could learn lots of...

