Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails 3 validation
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
Gemfile
README.md
Rakefile
validates-belongs-to.gemspec

README.md

Build Status

Rails 3 validation to ensure that two ActiveModel associations are related to each other.

class JobApplication
  belongs_to :resume
  belongs_to :user
  validates :resume, :belongs_to => :user
end

The validation checks that job_application.resume.user is the same as job_application.user.

Installation:

gem 'validates-belongs-to'
Something went wrong with that request. Please try again.