richardkmichael/rails — Issue #4: ARec finders are inconsistent.
Author: richardkmichael
Created: 2011-12-26 18:59:17+00:00
State: open

```ruby
u = User.create( :username => 'testuser', :password => 'testpass' )
User.find(u)
```

is a special case, calling User.find_one which takes an `ActiveRecord::Base` object and uses it's `id` for `find()`.

Therefore,

```ruby
u = User.create( :username => 'testuser', :password => 'testpass' )
User.find_by_username(u)
```

Does not work. It should (introspecting the method name) to determine the field for `WHERE foo = `.

This would also help clean up `ActiveRecord::Base#find_or_create_by_*` dynamic finders, which would not need additional parameters or a block (for the `.create()`).