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

Underscored column name on association #111

Open
vjnunez opened this issue Nov 15, 2012 · 0 comments
Open

Underscored column name on association #111

vjnunez opened this issue Nov 15, 2012 · 0 comments

Comments

@vjnunez
Copy link

vjnunez commented Nov 15, 2012

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant