Ever wanted to find the index of an ActiveRecord object in a collection? By collection, I’m referring to both associations and named scopes, the two types of lazy-loaded object collections available in ActiveRecord.
Suprisingly, Rails offers no easy way of doing this without loading the entire collection. This is fine for small collections, but once your data grows the operation will become more expensive.
Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago