gioco icon indicating copy to clipboard operation
gioco copied to clipboard

Couldn't find User with 'id'=all

Open Sigularusrex opened this issue 9 years ago • 7 comments

Hello, I'm getting the following error when I try adding a badge

ActiveRecord::RecordNotFound: Couldn't find User with 'id'=all

I have set up according to the docs. The command I'm using is rake gioco:add_badge[blank_canvas,0,author,true]

Sigularusrex avatar Feb 12 '15 09:02 Sigularusrex

I just checked the admin panel of my app, it looks like it has added (Multiple times) The kind has also been added once. but badges haven't been assigned to anyone.

Sigularusrex avatar Feb 12 '15 09:02 Sigularusrex

I'll check it @Singularusrex If you want, you can also try our pro version (http://gioco.pro)

joaomdmoura avatar Feb 12 '15 09:02 joaomdmoura

Great, thanks for getting back to me so quickly.

Sigularusrex avatar Feb 12 '15 09:02 Sigularusrex

Additionally, kind = Kind.where(:name => "author") user.change_points({ points: 100, kind: kind.id })

is giving me: undefined method `id' for #Kind::ActiveRecord_Relation:0x007f8c39d0b958

It looks like very little is working at the moment.

Sigularusrex avatar Feb 12 '15 09:02 Sigularusrex

btw, your premium tool looks great!

Sigularusrex avatar Feb 12 '15 10:02 Sigularusrex

Yeah @Sigularusrex I haven't maintaining Gioco for a while, I was deeply focused on Gioco Pro. But we, as a company, plan to keep the Open Source project alive! As soon as I finish a WIP that I'm involved with Active Model Serializer I will try to fix the major bugs and update the gem to work with new versions.

Right now I strongly recommend you to user Gioco Pro, we have an awesome support team, and if you decide to use it I may give you another 30-days trial :) Just reach me out at joaomdmoura[at]gioco[dot]pro in case you need anything.

joaomdmoura avatar Feb 12 '15 12:02 joaomdmoura

@Sigularusrex try using kind = Kind.find_by(:name => "author") instead of .where - it will return the correct object type that has an id attribute.

#78 has been submitted to resolve applying default badges to all users (incorrectly referencing #17).

You can apply the fix in your local gioco.rake (the example below based on a User model):

L24:

resources = User.all

L27:

.... :kind_id => kind.id

brettcave avatar Jul 05 '16 15:07 brettcave