Comment

Comment by mdasen

Rails has really kept up its development pace nicely. Nested assignments and forms are a wonderful addition. Dealing with related data (in forms and saving) had always been quite a pain and they've done a great job of making that a lot easier.

Some things not mentioned in the slideshow that were important (at least in my opinion):

* Dynamic scopes: you can say Article.scope_by_XXX and it will allow you to use scopes without explicitly naming all of them.

* Batch processing: this allows you to get the results of a query in smaller batches so that you don't have to load everything into memory at once.

* Rack support: it's nice to have Rails being able to be deployed in the way that the community is going for Ruby apps.

* Try: probably one of the best additions. It allows you to say @person.spouse.try(:first_name). Normally, if the person didn't have a spouse and you did @person.spouse.first_name you'd get an exception saying that nil (which is what @person.spouse would evaluate to) doesn't have a method first_name - which is true. This way you don't have to keep saying, "only call @person.spouse.first_name if the @person has a spouse".

* Application Templates: These are basically shortcut files you can make for setting up a new project. We all have slight variants and we can set up the default things we want in all our applications so we aren't starting from such a blank slate (and that way you don't forget to do things like create a .gitignore file before you put your database password out there for the world to see).

parent mdasen 17 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton