How to use read_attribute when manually defining getter/setter (attr_accessor or attr_writers)
问题 I set up a search model and want to require at least one field is filled out. I found a question that helps with the validation, Rails: how to require at least one field not to be blank. (I tried all answers, but Voyta's seems the best.) The validation is working, except when I want to redefine the getter/setter via attr_accessor or attr_writer . (I have virtual attributes on the form that need to be apart of the validation.) To figure out what the problem is, I tested with an attribute that