This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Loading…
Labels












For a quick fix try:
CoolResource.new(:owner => current_user.attributes)
???
or:
CoolResource.new(:owner_id => current_user.id)
Hmm, weird. Looking at your backtrace, it seems to think that current_user is an Array.
Can you try again and also do a current_user.inspect to show us what is being passed in ?
The quick fix I went for was more like:
c = CoolResource.new
c.owner = current_user
Cool. Good to know there's at least a workaround.
I have this vague feeling that ActiveRecord has similar issues with accepting real objects for associations on creation. Not sure why - it seems pretty sensible that it should accept it...
Still, I find it weird that HyRes seems to think that current_user is an Array.
could you try:
u = User.find(1)
c = CoolResource.new(:owner => u)
just to be sure it's not something weird coming out of current_user ???
It's probably not - but it'd be good to be certain.
I've had a go at it myself and I can say that using "find" it seems to work for me... but then I had to hack together a fake HyRes object. In my case my CoolResource has_one :user
is yours has_one or belongs_to?