Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Underscored column name on association #111

Description

@vjnunez

I have a User model:

class User < ActiveRecord::Base
  has_one :other_details
end

and then:

class OtherDetails < ActiveRecord::Base
  belongs_to :user
end

In my other_details table, i have a column named "receive_emails" that is a boolean, when i try to search by this attribute using:

f.check_box other_details_receive_emails_is_present

I get:

undefined method `other_details_receive_emails_is_present' for #<MetaSearch::Searches::User:0x007fbcd656def8>

After minutes of trying everything possible, i discovered this error is due the underscored column name (receive_emails). If i try another attribute (say "state") it works as expected.

Any workarounds to this particular issue? Am i forced to change this column name (remove the underscore?).

Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions