Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Underscored column name on association #111

Open
vjnunez opened this Issue · 0 comments

1 participant

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.