fix calculation without conditions
Merge pull request #341 from korobkov/master

update rails versions