• Category Archives: ActiveModel

ActiveResource relations – a bit of magic to make it look and feel more like ActiveModel relations

ActiveResource collection new problem ActiveResource can be pretty helpful when you have a RESTful JSON API. Although it has some limitations. One of the most irritating is a lack of nested resources new scope method. When you have structure like this: You can do some basic stuff: But unfortunately if you try something like this: […]

Read more at the source

State Machine gem and Rails (ActiveModel) 4.1 – NoMethodError – protected method ‘around_validation’ called for StateMachine

State machine is a great gem, unfortunately it’s not working with Rails 4.1. If you upgrade your app and try to use it, you’ll end up with following error: Here’s a fix. Just put it into your initializers: Note: It works also for any non-Rails, ActiveModel based apps.

Read more at the source

Upgrading to Rails 4.1 from Rails 4.0 – Ruby on Rails

Upgrading to Ruby on Rails 4.1 was much easier than moving from 3.2 to 4.0. Maybe because I try to keep all the apps up-2-date, maybe because Rails guys didn’t change much stuff ;) (or maybe both). Either way, lets get through it. Paperclip – String based terminators are deprecated, please use a lambda Well […]

Read more at the source