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 8114401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:08:02+00:00 2026-06-06T03:08:02+00:00

I have an attribute for my users called :last_request_at, :null => false I need

  • 0

I have an attribute for my users called :last_request_at, :null => false

I need to set this attribute to the current time on sign up / create. But I don’t know how?

a hidden field in the sign up form maybe? If yes how would that look like? Or how does Devise set his trackable attributes on signup/create to the current time?

EDIT

I put this in the user model:

before_save :set_last_request

def set_last_request
  self.update_attribute(:last_request_at, Time.now)
end

but then I get:

stack level too deep
  • 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-06T03:08:04+00:00Added an answer on June 6, 2026 at 3:08 am

    I would set the attribute in your controller action. Your stack level too deep error is because update_attribute calls save at the end. You are infinitely calling set_last_request.

    I would just call @record.last_request_at = Time.now in your controller action, or modify your before_save hook to just do self.last_request_at = Time.now.

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

Sidebar

Related Questions

i have a table called users this what the table look like CREATE TABLE
Im working on a simple rails project were users have an attribute called is_admin,
I have two tables, Users and People, both of which share a common attribute,
I have a table of users called Users And a view called UsersActive that
I have an array of users who are friends. Let us call this array:
I have been trying to find the answer to this simple question - but
In my db I a have table called users. In that table I have
I have projects and users joined via has_many :through join model called ownerships. Each
In my application I have two ways of singing up users: Sign up form
I have code that sorts an ArrayList of elements based on one attribute called

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.