that doesn’t seem to work… that throws “TypeError: can’t dump anonymous
class Class”
I’ve already tried stuff like: @user = User.find(1) # an object of type User not AdminUser @user.type = AdminUser @user.save # Throws the same error as above
@user[:type] = AdminUser @user.save # Throws the same error
On Mon, May 22, 2006 at 06:43:31PM +0900, Levent A. wrote:
} Joey wrote:
} > user[:type] = AdminUser
}
} that doesn’t seem to work… that throws “TypeError: can’t dump
anonymous
} class Class”
}
} I’ve already tried stuff like:
} @user = User.find(1) # an object of type User not AdminUser
} @user.type = AdminUser
} @user.save # Throws the same error as above
}
} @user[:type] = AdminUser
} @user.save # Throws the same error
You can’t set it to the class, you need to set it to the name. It’s a
subtlety:
On Mon, May 22, 2006 at 06:43:31PM +0900, Levent A. wrote:
} Joey wrote:
} > user[:type] = AdminUser
}
} that doesn’t seem to work… that throws “TypeError: can’t dump
anonymous
} class Class”
}
} I’ve already tried stuff like:
} @user = User.find(1) # an object of type User not AdminUser
} @user.type = AdminUser
} @user.save # Throws the same error as above
}
} @user[:type] = AdminUser
} @user.save # Throws the same error
You can’t set it to the class, you need to set it to the name. It’s a
subtlety:
user[:type] = ‘AdminUser’
–Greg
I’m an idiot
Thanks… I can’t believe I didn’t think of that… that’s what happens
when you spend hours on a simple thing, over thinking the problem…
thanks again
levent
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.