Document complex validations better #15

Open
pascalh1011 opened this Issue Dec 27, 2011 · 0 comments

Comments

Projects
None yet
1 participant
Owner

pascalh1011 commented Dec 27, 2011

Some validations in the migrant DSL can get very complex and generate interoperability issues with different Ruby versions.

See presidentbeef/brakeman#25

Possible solutions

  • Expanded documentation to give further validation examples (serving as 'templates' if you like)
  • Simplified multiple validations (perhaps writing the field declaration as a block or something)
structure do
  some_really_validated_field do
    validates :presence
    validates :inclusion, :in => %w(Apple Pear)
  end 
end

Just throwing some ideas around right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment