Web development blog

Uncategorized

Advanced SQL and named scopes stack with ActiveRecord

Jan.24, 2010

If you ever work with rails application that is a little bit more complex then a simple CRUD you would know that some of the ActiveRecord magic doesn’t work for complex SQL queries. I am primary talking about named scopes stack feature.
(continue reading…)
Leave a Comment :, , , , , more...

Vim as IDE - new development era for me

Dec.01, 2009

I was using Vim to do the minor editing in config files for ages. Vim is advanced on basic navigation and editing operations. However I was always prefer IDE for programming because of it’s specific to language navigation(’go to definition’ feature is awesome!), integrated debugger. But while gaining the experience I noticed that all advanced features began to be less important then basic ones. And you should try Vim if you feel the same.
(continue reading…)
1 Comment :, more...

Objects behaviour inheritance with RSpec

Oct.27, 2009

About half of a year ago I was writing about object interface and Liskov Substitution Princeple. In short: Any class instance that extends the base class should pass all unit tests behaviour tests written for base class instance. It was a surprise for me that this concept has already been implemented in RSpec.

(continue reading…)
3 Comments :, , , , more...

Double select from a single table in complex SQL query.

Jun.02, 2009

When I start learning SQL I have to write a lot of nested queries when working on complex select statements from a single table. Now, I feel more comfortable with it and show how to avoid nesting. There are cases when you have to compare one row of the table with all others to get the result:
  • Select next element to current by the value of some field
  • Select records that are unique by some complex expression
  • Select all records that have the same parameter as given record.
You can get rid of nesting in all above cases. Let’s review the example. (continue reading…)
Leave a Comment :, , , more...

How to choose a sexy title for your article

May.13, 2009

Most of the people will not spend a minute reading your article if they wouldn’t get interested from the very beginning. What resides at the beginning of any article? It is the title of course. That is why choose a good title is very important for every content posted in the net. (continue reading…)
Leave a Comment :, , , , , more...

The Content of this blog can be published anywhere with the link to original source.