# Class query: Classname.find(class)

**URL:** <https://www.ruby-forum.com/t/class-query-classname-find-class/87895>\
**Category:** Rails\
**Created:** [March 6, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/class-query-classname-find-class/87895 "2007-03-06T17:55:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@akm](https://www.ruby-forum.com/u/akm)\
**Post date:** [March 6, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/class-query-classname-find-class/87895/1 "2007-03-06T17:55:54Z")

</div>

Hi,  
I have implemented the following:

```
@newUser = Usertbl.new
@newUser.username = 'first'
@newUser.userpassword = 'last'
@userDetails = Usertbl.find(@newUser)

```

and am getting the following error message:

‘Couldn’t find Usertbl with ID=#Usertbl:0x4783fa8’

Why is this not allowed?

–  
Regards

Andrew

---

<div class="post-metadata">

**Author:** ![akm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@akm](https://www.ruby-forum.com/u/akm)\
**Post date:** [March 6, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/class-query-classname-find-class/87895/2 "2007-03-06T17:58:55Z")

</div>

find() expects either numeric ids or :first or :all followed by more  
conditions. Please see

> **[ActiveRecord::Base](https://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000992)**
>
> Active Record Active Record objects don't specify their attributes directly, but rather infer them from the table definition with which they're linked.

for more info.

- Doug Barth
