schneems/Likeable — Issue #11: find_by_resource_id always returns only the first result
Author: styx
Created: 2011-12-14 15:05:34+00:00
State: open

I've tried the seq in `rails c`:

```
Likeable.find_by_resource_id("Comment", 15)
Likeable.find_by_resource_id("Comment", 16)
Likeable.find_by_resource_id("Comment", 56)
```

but I'm always getting 'Comment id: 15'

Here is the log what is going on:

```
>> Likeable.find_by_resource_id("Comment", 15)
Comment Load (0.7ms) SELECT "comments".* FROM "comments" WHERE "comments"."id" = 15 LIMIT 1
=> #
>> Likeable.find_by_resource_id("Comment", 16)
Comment Load (0.7ms) SELECT "comments".* FROM "comments" WHERE "comments"."id" = 15 LIMIT 1
=> #
>> Likeable.find_by_resource_id("Comment", 56)
Comment Load (0.6ms) SELECT "comments".* FROM "comments" WHERE "comments"."id" = 15 LIMIT 1
=> #
```

P.S. Rails 3.1.3 / Postgresql if matters.