acts_as_list - null scope attribute value
Some time ago I ran into performance problems connected with acts_as_list.
My acts_as_list in EmailAddress model was defined as follows:
acts_as_list :scope => :userUnfortunately, most email addresses in database had user_id set to null.
Acts_as_list takes all records from table which has null scope attribute and creates one huge list from all of them… Ups… In my situation it means almost
SELECT * FROM email_addressesHere is my fix. It makes possible to write:
acts_as_list :scope => :user, :ignore_nil => trueAfter doing so, newly created EmailAddress will not be added to any list unless user is set to non null.
In my opinion original behaviour is quite odd as acts_as_list supports listable records which are not on any list…

My name is Kacper Bielecki. I am currently working at 