Skip to content

Instantly share code, notes, and snippets.

@vividtone
Created November 22, 2011 08:41
Show Gist options
  • Save vividtone/1385200 to your computer and use it in GitHub Desktop.
Save vividtone/1385200 to your computer and use it in GitHub Desktop.
Redmine: add validations to exsiting models.
module AddIssueValidation
def self.included(base)
base.class_eval do
validates_presence_of :category
validates_presence_of :due_date
validates_presence_of :fixed_version
end
end
end
Issue.send(:include, AddIssueValidation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment