RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

A lightweight way to handle different validation situations

Say you have an Article model, and it could be either a draft or a published article. The published article needs more validation than the draft. What’s the best way to write this? Rails has a lightly documented, little-known feature that makes these problems really easy to handle.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in