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

  • Home
  • SEARCH
  • 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 6008667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:51:26+00:00 2026-05-23T01:51:26+00:00

I ignorantly named a model in my Rails app System , which is also

  • 0

I ignorantly named a model in my Rails app System, which is also a ruby core method. This model is in a relationship with another model Project, which I am trying to index.

Ideally, I am looking to setup my index like this:

define_index do
  indexes :name, :sortable => true
  indexes system(:name), :sortable => true, :as => :system_name
end

I could change the model name, but I’d call that a compromise, and I’m not convinced I need to. Is there a good work-around for this?

ruby 1.8.7, rails 3.0.7, thinking_sphinx 2.0.3

  • 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-23T01:51:27+00:00Added an answer on May 23, 2026 at 1:51 am

    The good work around for naming variables or user-level Classes with reserved words (language keywords and platform-level methods/classes) is not do it in the first place.

    The second best workaround is to use scoping :: to make sure the name you are calling is the one you want

    ::system()  # calls the actual system method as defined by Ruby
    APPNAME::MODEL_NAME # would call the model defined as `APPNAME::MODEL_NAME`
    

    I can’t really think of a workaround without namespacing your models (although knowing Ruby, its more than possible some functionality exists– just never needed it myself). Prolly all of them tbh since it would get even more confusing if only half your models were namespaced. In the long run, its just more typing remembering to namespace everything.

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

Sidebar

Related Questions

Is it possible to compile a project in 32-bit with cmake and gcc on
This may be an ignorant question, but I'm unsure why I can not use
I've read a great deal of discussion recently (both on this site and elsewhere)
I started switching some pre-existing nHibernate code in a Sharepoint-based ASP.NET project from eager
I have to start off by saying I have very little idea on this
I have the task to program one module to store some data and another
I have a C# class library which starts up a background consumer thread (lazily)
I am fetching current data from another company's web feed. It is a simple
It's my second ignorant question for today, this one even more ignorant than the
i'm daily in the process of learning new things about Rails (started learning 2

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.