-
Notifications
You must be signed in to change notification settings - Fork 0
chrisharper/fake_model
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
# README fake_model allows you to replicate a non persisted ActiveRecord model with validations. This is useful for cases where you want validations but do not need persistance. # Usage class Person include FakeModel fake :name , :age validates :name , :presence => true validates :age , :presence => true end james = Person.new :name => 'James' , :age => 40 james.valid? # true Person.fake_attributes # [:name , :age] james.attributes # {:name => 'James' , :age => 40} james.age = 50 # true james.age # 50 All validations included in ActiveRecord are available.
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published