GithubHelp home page GithubHelp logo

isabella232 / validates_existence_of Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unity-technologies/validates_existence_of

0.0 0.0 0.0 91 KB

A small plugin to validate the existence of an AR record

License: MIT License

Ruby 100.00%

validates_existence_of's Introduction

Validates Existance Of Plugin

Validates the existance of an associated record in the database through a belongs_to association.

validates_existance_of :ar_belongs_to_association

Supports polymorphic associations.

Usage

validates_existance_of :belongs_to_association

Example

class Country < ActiveRecord::Base

  has_many :users

end

class User < ActiveRecord::Base

  belongs_to :country

  validates_presence_of :country_id

  # Will pass if the associated country exists in the database
  validates_existance_of :country 

end

Instalation

git clone git://github.com/bogdans83/validatesexistanceof.git

or use “braid”: evil.che.lu/projects/braid

Uninteresting stuff

Author:: Bogdan Sandulescu <bogdan at okapistudio the point com>
License:: Copyright 2008 Bogdan Sandulescu
          Released under an MIT-style license.

validates_existence_of's People

Contributors

bogdansss avatar ropiku avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.