Null migration, or What to do when there are too many migrations

Migrations are probably one of the most killer features of ActiveRecord. They allow you to design the architecture of the database along with the growth of your project. If you change your data model (Domain Model), you reflect that change in code and write a migration (or several migrations), which will make the necessary actions on your database schema. This may be creating a new table, deleting a column or adding an unique index.

Don't do this at home on Rails #2

  • Languages: Ruby
  • Difficulty: Easy

Intro

Now is the time to break down the next three examples of code that look slightly chapped, and just beg to be retouched. Despite the apparent complexity, by running a series of easy refactorings, we can significantly improve the code: reduce the size, improve the readability and even increase its speed. Who knows?

Validating nested associations in Rails

Intro

Rails provide a wide range of options for creating rich forms for your models. This can be a simple form for one object, or the form for many related objects. Usually it is a parent-children relations. If you are not familiar with such terms as form_for or accepts_nested_attributes_for, I strongly recommend taking a look at this article Complex Rails Forms with Nested Attributes, written by Xavier Shay, which will show your how you can create complex forms with Rails.

Автоматизация тестирования в RoR

Буквально вчера я вернулся с конференции веб-разработчиков ЧЕБИТ'12-10. В этом году она проходила в баре “Манхеттен”, что придавало ей нотку закрытого подпольного казино для “своих”. Огромное спасибо за приглашение поучавствовать от Данила Письменного (@pismenny) и Ассоциации Региональных Веб-Разработчиков. Также хотелось бы отдельно упомянуть Александра Рожнова (@NOX_73) и поблагодарить за надежную доставку!

Don't do this at home on Rails #1

  • Languages: Ruby
  • Difficulty: Easy

Intro

These series of articles will be dedicated to every day code, that I am working on. This could be the parts of my own projects or some ruby gems. Together, we will try to improve quality and readability of it.