Is the new named_scope feature a full implementation of has_finder?
I'am just coding about 50 has_finder lines and I asked myself if it's a good idea to wait for 2.1 final and use named_scope instead.
Is the new named_scope feature a full implementation of has_finder?
I'am just coding about 50 has_finder lines and I asked myself if it's a good idea to wait for 2.1 final and use named_scope instead.
Yes, named_scope is the renamed and integrated-to-core port of has_finder.
You don’t have to wait for 2.1, you can use has_finder and just rename the method when you update to Rails 2.1. The basic API is the same (I’m unaware of differences).
If you’re using will_paginate library, I backported named_scope there for Rails 1.2.6 and 2.0.2. Just install mislav-will_paginate from GitHub and do this:
gem ‘mislav-will_paginate’, ‘>=2.2.0’
require ‘will_paginate’ WillPaginate::enable_named_scope
Of course, this detects native named_scope and has no effect when the app is upgraded to Rails 2.1.