So, I am looking at the link, but I am wondering how to do "OR" instead of "XOR". Does anyone know how to do this? I am trying to do this with Rails 3.
I get it. all you need to change is ^ to &&
private def time_or_money if time.blank? && money.blank? errors[:base] << "Specify Time, Money or Both." end end
There is a short option for Rails 4 (not sure about Rails 3):
validates :email, presence: { if: -> { username.blank? } } validates :username, presence: { if: -> { email.blank? } }
Source: https://habr.com/ru/post/1205111/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1205106/is-there-anyway-to-merge-cobertura-coverage-xml-reports-together&usg=ALkJrhj-y04n0-h1aDWEEAMvMMI1tyMoIAIn C ++, how to wrap default headers with fallback - c ++Combine coberture code coverage reports in three separate projects - code-coveragehttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1205109/how-do-i-set-factor-levels-to-the-order-they-appear-in-a-data-frame&usg=ALkJrhh9C0HDBk5WtI_v4VooJI-FlC5DoAA socket server waiting for messages from a client to read - javaRstudio knit pdf in Rstudio loadNamespace (name): no package called 'rmarkdown' - rC - expression must be a modifiable value lvalue - cFailed to debug using iOS 8.1 device - iosWhy can't I do arithmetic on a void index sheet? - cUsing the Swift Protocol in Objective-C - objective-cAll Articles