registration and session for rails 4 and pg