Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8705679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:25:30+00:00 2026-06-13T03:25:30+00:00

My user.rb looks like this: class User < ActiveRecord::Base attr_accessible :password, :password_confirmation, :crypted_password, :username,

  • 0

My user.rb looks like this:

class User < ActiveRecord::Base
  attr_accessible :password, :password_confirmation, :crypted_password, :username, :password_salt, :persistence_token
  acts_as_authentic
  has_many :assignments
  has_many :roles, :through => :assignments
  def role_symbols
    roles.map do |role|
      role.name.underscore.to_sym
    end
  end  
end

But I get this in rails console:

x = User.create(:username => "foo", :password => "bar", :password_confirmation => "bar")
   (0.2ms)  BEGIN
  User Exists (0.4ms)  SELECT 1 AS one FROM "users" WHERE LOWER("users"."username") = LOWER('foo') LIMIT 1
  User Exists (0.6ms)  SELECT 1 AS one FROM "users" WHERE "users"."persistence_token" = 'e3c363da87d37fc7f17d3d1f4d4c851b93cf974ae614ec0b0cb9eb1935dd2dc2ccab34d0a06b4580881dc38e5b65027cce0f2e53a005860fc81d7f5e4c245d6a' LIMIT 1
   (0.3ms)  ROLLBACK
+----+----------+---------+---------+---------+-------+---------+---------+
| id | username | cryp... | pass... | pers... | email | crea... | upda... |
+----+----------+---------+---------+---------+-------+---------+---------+
|    | foo      | 6196... | vIzV... | e3c3... |       |         |         |
+----+----------+---------+---------+---------+-------+---------+---------+
1 row in set
1.9.3-p194 :031 > User.all
  User Load (1.5ms)  SELECT "users".* FROM "users" 
 => [] 
1.9.3-p194 :032 > x.save
   (0.1ms)  BEGIN
  User Exists (0.6ms)  SELECT 1 AS one FROM "users" WHERE LOWER("users"."username") = LOWER('foo') LIMIT 1
  User Exists (0.3ms)  SELECT 1 AS one FROM "users" WHERE "users"."persistence_token" = 'e3c363da87d37fc7f17d3d1f4d4c851b93cf974ae614ec0b0cb9eb1935dd2dc2ccab34d0a06b4580881dc38e5b65027cce0f2e53a005860fc81d7f5e4c245d6a' LIMIT 1
   (0.1ms)  ROLLBACK
 => false 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:25:31+00:00Added an answer on June 13, 2026 at 3:25 am

    Realised that :email needed an attr_accessible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a TakeAction model that looks like this: class TakeAction < ActiveRecord::Base belongs_to
I have a model called Action. It looks like this: class Action < ActiveRecord::Base
I've got polymorphic association which looks like class Certificate < ActiveRecord::Base attr_accessible :certification_id, :certified_id,
I have this classes. user: class User < ActiveRecord::Base attr_accessible :email, :name has_many :berichten
I have a model that looks something like this: class Comment < ActiveRecord::Base ...
I have a class User that looks like this: class User { private: char*
I have a model that looks like this: class Invite(models.Model): user = models.ForeignKey(User) event
I am working with a Django model that looks like this: class Subscription(models.Model): user
My user activity log looks something like this: Id, Username, Date I need to
If I have the following code: class User < ActiveRecord::Base has_many :problems attr_accessible :email,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.