Remove example file

This documentation should be in the guides.

Closes #16691
This commit is contained in:
Rafael Mendonça França 2014-09-04 14:06:40 -03:00
parent 40f9407b87
commit 703a2e8da1
1 changed files with 0 additions and 30 deletions

View File

@ -1,30 +0,0 @@
require File.expand_path('../../../load_paths', __FILE__)
require 'active_model'
class Person
include ActiveModel::Conversion
include ActiveModel::Validations
validates :name, presence: true
attr_accessor :name
def initialize(attributes = {})
@name = attributes[:name]
end
def persist
@persisted = true
end
def persisted?
@persisted
end
end
person1 = Person.new
p person1.valid? # => false
p person1.errors.messages # => {:name=>["can't be blank"]}
person2 = Person.new(name: 'matz')
p person2.valid? # => true