Skip to content

Instantly share code, notes, and snippets.

Created September 16, 2016 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/a29a3d05f7ad76bd1527c95cf9b11122 to your computer and use it in GitHub Desktop.
Save anonymous/a29a3d05f7ad76bd1527c95cf9b11122 to your computer and use it in GitHub Desktop.
class Hoge
validates :thing, presence: true, if: ->() { thing_update }
validates :color, presence: true, if: ->() { color_update }
validates :variant, presence: true, if: ->() { variant_update }
validates :quux, presence: true, if: ->() { quux_update }
validates :stuff, presence: true, if: ->() { stuff_update }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment