Skip to content

Instantly share code, notes, and snippets.

@nathancarnes
Forked from amiel/task.rb
Last active December 14, 2015 19:48
Show Gist options
  • Save nathancarnes/5138912 to your computer and use it in GitHub Desktop.
Save nathancarnes/5138912 to your computer and use it in GitHub Desktop.
class Task < ActiveRecord::Base
belongs_to :project
validates_presence_of :project_id
validate do
unless project.status == 'funded'
errors.add(:base, 'Project must be funded')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment