i've different users subclasses organised thanks to STI under a user
mother class, problem is that i can't find a way to exchange a user form
a certain type to an other , any light ???
class User < ActiveRecord::Base
end
class Guest < User
has_and_belongs_to_many :hosts,
:join_table => 'invitations'
end
class Host < User
has_and_belongs_to_many :guests,
:join_table => 'invitations'
end
#i'd like to change a Guest user to make him become Host :
You don;t need to dig that deep even for updating the attribute - just
foo.type = 'Blah' would do it.
Mass protection just means that it's ignored if you do
update_attributes, create, new or things like that.