Skip to content

itsmeduncan/corus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Corus

Use this gem to define what is not nullable related to an ActiveRecord backed class

Install

config.gem 'corus'

Usage

    class Foo < ActiveRecord::Base
        tartarus :bar
    end

    thing = Foo.create(:bar => :baz)
    thing.bar = nil
    thing.valid? #=> false

    thing.save! #=> #<ActiveRecord::RecordInvalid: Validation failed: Bar can't be changed from 'baz' to nil>

    thing.save #=> false

    thing.bar = "widget"
    thing.valid? #=> true

    things.save #=> true

License

See LICENSE for information.

About

Define what is not nullable related to an ActiveRecord backed class

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages