Web development blog

Tag: ruby

Advanced non-flat controllers hierarchy with rails

Jun.08, 2010

REST became the best practice for organizing CRUD server side interface. But what to do when we have something more than hello-world application that goes forward from data CRUD and provides many presentations of the same data with different filters and different layouts?
(continue reading…)
Leave a Comment :, , , , more...

Ruby1.8: ‘private’ doesn’t give expected level of privacy

Apr.05, 2010

The classic OOP pattern usually called encapsulation implemented in ruby with private and protected keywords methods. The distinction between API and implementation works great with both. The problem is that private doesn’t hide method for inherited classes. (continue reading…)
2 Comments :, , , , more...

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…)
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...

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