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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:39:34+00:00 2026-05-26T13:39:34+00:00

I have a simple ActiveRecord object representing an estimated time of arrival. class Eta

  • 0

I have a simple ActiveRecord object representing an estimated time of arrival.

class Eta < ActiveRecord::Base
    belongs_to :stop
    belongs_to :vehicle
    validates :timestamp, :presence => true
end

In my database, I created the corresponding columns stop_id, vehicle_id, and timestamp (of type datetime).

I have a rake task set up to perform operations on this table, but it is generating SQL that doesn’t make sense. If I try to run:

for eta in Eta.all
    puts eta.timestamp
end

It tries to SELECT * FROM eta, however the table is named etas, not eta.

The pluralized database naming is consistent with the rest of the tables created from ActiveRecord objects and I successfully created a similar ActiveRecord object that works correctly.

class PrecedingCoord < ActiveRecord::Base
    belongs_to :stop
    belongs_to :route
    belongs_to :coord
end

In the rake file:

for eta in PrecedingCoord.all
    puts eta.coord.latitude
end
  • 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-05-26T13:39:35+00:00Added an answer on May 26, 2026 at 1:39 pm

    Rails sets the plural of ETA as ETA.

    > 'eta'.pluralize
    => "eta"
    

    If you have already created a table called etas, you can set this in your model:

    class Eta < ActiveRecord::Base
      set_table_name "etas"
    
      belongs_to :stop
      belongs_to :vehicle
      validates :timestamp, :presence => true
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple model class Task < ActiveRecord::Base validates :deadline, :if => :deadline_in_future?
I have a simple validation: class Product < ActiveRecord::Base # include ActionView::Helpers::NumberHelper ... validates_numericality_of
I have a simple database table called Entries: class CreateEntries < ActiveRecord::Migration def self.up
With a simple model like that class Model < ActiveRecord::Base # ... end we
Im trying to setup a simple environment: class Member < ActiveRecord::Base has_many :microposts, :dependent
I have a simple has_many/belongs_to relationship between Report and Chart. The issue I'm having
I have a complex table pulled from a multi-ActiveRecord object array. This listing is
I have a simple level ASP.NET web application based on Castle ActiveRecord. How can
I have a simple rake task which consumes pretty much data via ActiveRecord. (contacts
Has anyone tried the ActiveRecord Intro Sample with C# 3.5? I somehow have the

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.