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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:55:20+00:00 2026-06-17T08:55:20+00:00

Why do I get this error? I do have ‘last_signed_in_at’ column in users table

  • 0

Why do I get this error? I do have ‘last_signed_in_at’ column in users table for sure.

Mysql2::Error: Unknown column ‘last_signed_in_at’ in ‘order clause’

My codes are

controller

@users = @post.likes

view

<% @users.order("last_signed_in_at DESC").limit(3).each do |user| %>
    <li>
        <%= user.profile.nickname %>
        <%= user.last_active_at %>    
    </li>
<% end %>

<%= debug(@users) %>

[#<ActsAsVotable::Vote id: 2, votable_id: 4, votable_type: "Post", voter_id: 1, voter_type: "User", vote_flag: true, created_at: "2012-12-22 13:30:37", updated_at: "2013-01-01 18:55:51">, 
 #<ActsAsVotable::Vote id: 7, votable_id: 4, votable_type: "Post", voter_id: 2, voter_type: "User", vote_flag: true, created_at: "2012-12-23 14:47:04", updated_at: "2013-01-02 00:36:48">]
  • 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-17T08:55:21+00:00Added an answer on June 17, 2026 at 8:55 am

    You scope ActsAsVotable::Vote, but somehow waiting for User 🙂

    Controller:

    @users = User.where(:id => @post.likes.map(&:voter_id)).order("last_signed_in_at DESC").limit(3)
    

    View:

    <% @users.each do |user| %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm trying to update my GridView, and I get this error: You have
I get this error, while I'm testing the code below: You have an error
I get this error message pageContext cannot be resolved but I have no variable
I get this error when I run the code below. I have normally used
I get this error when trying to link a win32 exe project. I have
I get this error by downloading an image by HTTP. I have looked at
I have a page called ..hi i get this error when visiting the page.
Even though I have a fermi card(gtx 560) I get this error on VS2010:
I have this code and I couldn't run it because i get this error:
I have a simple piece of Javascript code and I get this Error :

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.