-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I think we should rethink the name ''constraints'' for scoped
finder
options. It''s a broad term used for a very specific feature.
We''re
on the verge of 1.0 and will be locked in for a long time otherwise.
I''m primarily concerned because it evokes the widely-used notion of
relational db constraints without really being anything like them.
Since it''s a class method, it rules out ever having, for example,
declared constraints:
class Foo
constrain(:foo) { |foo| foo < 5 }
constrain(:foo) { |foo| foo === Integer }
constrain(:foo, foreign_key(:table => ''bazs'', :column
=>
''quux_id''))
end
Some suggestions:
Foo.with_find_options(:conditions => ''...'') { }
Foo.constrain_finder(:conditions => ''...'') { }
Foo.pull_up_your_pants(:conditions => ''...'') { }
jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)
iD8DBQFDYdq2AQHALep9HFYRAmpxAJ9DQ2hQAao9H0vSgDkhj5ohdwiJ7QCffUKA
d6Fhz39/TmAg0V/H5vuH12s=v2cG
-----END PGP SIGNATURE-----