1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel
jamie 0a79eb7889 Add validates method as shortcut to setup validators for a given set of attributes:
class Person < ActiveRecord::Base
  include MyValidators

  validates :name, :presence => true, :uniqueness => true, :length => { :maximum => 100 }
  validates :email, :presence => true, :email => true
end

[#3058 status:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-07 19:23:59 +01:00
..
examples Fix deprecated gem-name requires 2009-09-14 13:04:43 -07:00
lib Add validates method as shortcut to setup validators for a given set of attributes: 2010-01-07 19:23:59 +01:00
test Add validates method as shortcut to setup validators for a given set of attributes: 2010-01-07 19:23:59 +01:00
activemodel.gemspec Make gemspecs the authoritative source instead of generating them from the Rakefile 2009-09-25 00:46:13 -05:00
CHANGELOG Change the ActiveModel::Base.include_root_in_json default to true for Rails 3 [DHH] 2010-01-03 22:02:10 -05:00
CHANGES Introduce validates_with to encapsulate attribute validations in a class. 2009-08-09 22:47:56 -07:00
MIT-LICENSE License, version, and gemspec for ActiveModel. Ship it! 2009-08-31 19:09:16 -05:00
Rakefile Hush AMo test suite 2009-12-16 11:05:48 -06:00
README initial experimental commit of active_model 2007-11-09 14:59:15 +00:00

Active Model
==============

Totally experimental library that aims to extract common model mixins from
ActiveRecord for use in ActiveResource (and other similar libraries).  
This is in a very rough state (no autotest or spec rake tasks set up yet),
so please excuse the mess.  

Here's what I plan to extract:
  * ActiveModel::Observing 
  * ActiveModel::Callbacks
  * ActiveModel::Validations

	# for ActiveResource params and ActiveRecord options
  * ActiveModel::Scoping

	# to_json, to_xml, etc
  * ActiveModel::Serialization

I'm trying to keep ActiveRecord compatibility where possible, but I'm
annotating the spots where I'm diverging a bit.