Igor Alexandrov

Programming and something else…

Using Git Subtree to Share Code Between Rails Applications

| Comments

For different reasons (mainly NDA) I cannot write real project names in this post. To make all things clear, let’s say that we have one project called FooLog (Rails 3.2) and we have to create new project called FooMarket (Rails 3.2 too) that uses data and ROI algorithms from FooLog.

As it usually happens at the beginning of the development, FooMarket seemed to us a very simple project with a pair of controllers and five or eight models. We wanted to add simple API to FooLog and authorise FooMarket to load data from FooLog through this API (with OAuth for example). After a couple of conference Skype-calls with our customers we understood that we are doing something bigger then two controllers and five models and I said – “OMG! We are trying to create another FooLog here! Why we cannot just add another section to FooLog and call it FooMarket?”. The answer was: “Because of marketing. FooLog and FooMarket are two different investment projects and should work separately”.

ipgeobase.ru Support in Geocoder Gem

| Comments

For some reason geocoder gem don’t have support of ipgeobase.ru out of the box.

You may don’t know this, but ipgeobase.ru is leading ip-geocoding service in Russia and Ukraine. Its accuracy of coordinates detection for Russian ip-addresses is much higher then in the freegeoip.net. For example, I live in Tver and my home ip-address is 213.5.102.43; freegeoip tells me that I am in Moscow, ipgeobase tells me that I am in Tver, about 150 kilometres difference!

That’s why I decided to add support of ipgeobase to geocoder.

Rails Presenters and Filters

| Comments

Part 1: Introduction and Filters

How ofter do you use Presenter Patter in your Rails applications? I do it when I have really complex views and want to move all logic from template file to some Ruby class. Usually this can be done when you have listing of items with paginations, per page selector sorting and filter for these items. In this post I want to show you my approach for such situations.

Итоги Rails Rumble и Gem Яндекс.Метрика

| Comments

Rails Rumble закончился и к сожалению наше приложение IDEA HQ не вошло в десятку лучших. Почему? Скорее всего не хватило опыта участия в подобных соревнованиях. Нужно было готовиться заранее и очень серьезно. Тем не менее мы сделали очень много серьезных выводов и это уже очень приятно.

Кроме того сегодня успел выпустить очередную версию gem Metrika – инструмента для работы с API Яндекс.Метрика. В этой версии уже можно получать/создавать/обновлять счетчики и цели, фильтры, операции и права доступа к ним. Пока всё это работает в виде JSON обёртки, уже скоро начну работать дальше над объектной вариантом.