I have tried the devise rails gem, and was wondering what the best way would be to split the user model attributes it creates across multiple models.
For now, my user model looks as follows, which is the default devise behaviour:
User(id: integer, email: string, encrypted_password: string, password_salt: string, reset_password_token: string, remember_token: string, remember_created_at: datetime, sign_in_count: integer, current_sign_in_at: datetime, last_sign_in_at: datetime, current_sign_in_ip: string, last_sign_in_ip: string, created_at: datetime, updated_at: datetime)
I would like to have some of the attributes below in another model, e.g. Watchdog
sign_in_count, current_sign_in_at, last_sign_in_at, current_sign_in_ip, last_sign_in_ip
I was considering of simple delegating them using the delegate method:
delegate :sign_in_count, :sign_in_count=, ..., :to => :watchdog
Would be interested in hearing about better solutions to this problem.
Thanks,
Sergio