issues with model in ruby on rails

class SystemAdmin < ActiveRecord::Base

belongs_to :user

end

class User < ActiveRecord::Base

has_secure_password

Since you've defined the association as a has_one, you should use it in the singular:   if !@user.system_admin.nil?

but "!...nil?" is a bit stinky; either use:   if @user.system_admin or   unless @user.system_admins.nil?

Thanks, got the solution…