aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
Commit message (Collapse)AuthorAgeFilesLines
* Get rails tests running on bundler 0.9Carl Lerche2010-01-311-7/+1
|
* Axe AM state machineJoshua Peek2010-01-305-560/+0
| | | | We're going do it eventually, get it done before 3.0 is final.
* Drop AR I18n deprecation and simple use errors.messages as fallback.José Valim2010-01-301-14/+14
|
* Adding Proc support to validation messages so that they can become a little ↵Samuel Elliott2010-01-171-0/+8
| | | | | | more dynamic, allowing for customisations during the request [#3514 status:resolved]. Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix typos and add tests to ensure they will be caught the next time.José Valim2010-01-111-0/+8
|
* Fix typo by renaming :genre to :gender.José Valim2010-01-092-7/+7
|
* Allow validates to map some types to specific options. So now you can do:José Valim2010-01-082-12/+38
| | | | | | validates :email, :presence => true, :format => /@/ validates :genre, :inclusion => %w(m f) validates :password, :length => 6..20
* Compile length validator options still at the class level, so whenever the ↵José Valim2010-01-081-4/+2
| | | | validator is called, it just needs to check for :maximum, :minimum and :is values.
* Allow :if, :unless, :on, :allow_nil and :allow_blank as shared options in ↵José Valim2010-01-072-3/+42
| | | | validates.
* Add validates method as shortcut to setup validators for a given set of ↵jamie2010-01-075-2/+92
| | | | | | | | | | | | | | | 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>
* Allow to specify default attributes names translation in I18n yml files.José Valim2010-01-071-0/+5
| | | | | | | | | | | | For example, you could easily specify :created_at and :updated_at translations as: en: attributes: created_at: "Created at" updated_at: "Updated at" This configuration is built on ActiveModel, so it means those translations are shared between different ORMs as well (but always as a fallback).
* Be sure to dup load paths before clearing the array.José Valim2010-01-071-1/+1
|
* Errors messages are now moved from :activerecord.errors to simply :errors on ↵José Valim2010-01-072-80/+44
| | | | I18n yml files.
* Autoload AR test caseJoshua Peek2010-01-041-2/+0
|
* Autoload AMo test caseJoshua Peek2010-01-041-1/+0
|
* Add missing tests to Validators.José Valim2010-01-031-0/+47
|
* Remove deprecated ActiveModel tests (%d and %s is no longer supported in ↵José Valim2010-01-021-14/+0
| | | | error messages a couple months already)
* Add naming to AMo::LintJosé Valim2010-01-021-0/+2
|
* Use activerecord.errors.format as in Rails 2.3.5.José Valim2010-01-021-0/+6
|
* Be sure to convert namespaced names to we have 'Parrots name' instead of ↵José Valim2010-01-022-1/+7
| | | | 'Parrots.name' in error messages.
* Move ActiveRecord callbacks implementation to ActiveModel and make use of it.José Valim2009-12-281-0/+70
| | | | Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
* No need to use ValidationsRepairHelper hack on ActiveModel anymore, ↵José Valim2009-12-2313-202/+120
| | | | Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there.
* Small clean up in Naming and TTranslation tests.José Valim2009-12-234-22/+25
|
* Move validations in ActiveModel to validators, however all validatity checks ↵José Valim2009-12-231-2/+2
| | | | are still in the class method.
* Validator is simply sent to validate method. However, the API needs to ↵José Valim2009-12-221-6/+6
| | | | change, so validate accepts a record.
* Fully expand relative rails framework paths and make sure we aren'tJoshua Peek2009-12-161-4/+2
| | | | adding any to the load path more than once.
* Reorganize autoloads:Carlhuda2009-12-022-0/+2
| | | | | | | | | | | | | | | | | | | | | * A new module (ActiveSupport::Autoload) is provide that extends autoloading with new behavior. * All autoloads in modules that have extended ActiveSupport::Autoload will be eagerly required in threadsafe environments * Autoloads can optionally leave off the path if the path is the same as full_constant_name.underscore * It is possible to specify that a group of autoloads live under an additional path. For instance, all of ActionDispatch's middlewares are ActionDispatch::MiddlewareName, but they live under "action_dispatch/middlewares/middleware_name" * It is possible to specify that a group of autoloads are all found at the same path. For instance, a number of exceptions might all be declared there. * One consequence of this is that testing-related constants are not autoloaded. To get the testing helpers for a given component, require "component_name/test_case". For instance, "action_controller/test_case". * test_help.rb, which is automatically required by a Rails application's test helper, requires the test_case.rb for all active components, so this change will not be disruptive in existing or new applications.
* Avoid adding component lib/ to load path multiple timesJoshua Peek2009-11-091-1/+3
|
* Move validator, human_name and human_attribute_name to ActiveModel, remove ↵José Valim2009-10-205-6/+64
| | | | | | deprecated error messages and add i18n_scope and lookup_ancestors. Signed-off-by: Carl Lerche <carllerche@mac.com>
* Have all the tests running off a single GemfileYehuda Katz + Carl Lerche2009-10-201-7/+6
|
* Bundle AMoYehuda Katz2009-10-151-2/+7
|
* Rewrite ActiveModel::Lint as a simple TU mixinJoshua Peek2009-10-071-32/+8
|
* Fixed behavior of attribute_methods_generated? [#3220 state:resolved]Sam Pohlenz2009-10-071-0/+26
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Don't share attribute matchers between classes [#3216 state:resolved]Sam Pohlenz2009-10-071-0/+20
| | | | | | | Allows separate models that include ActiveModel::AttributeMethods to use different sets of attribute matchers. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Use ActiveModel::TestCase base classJeremy Kemper2009-09-243-4/+4
|
* Ensure validation errors to be ordered in declared orderAkira Matsuda2009-09-111-0/+16
| | | | | | [#2301 state:committed milestone:2.3.5] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-084-23/+10
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Fix warnings in AMoJoshua Peek2009-09-054-47/+4
|
* Fix failing AMo isolated testsJoshua Peek2009-09-054-0/+7
|
* added proc and symbol support to validates_numericality_of [#3049 ↵Kane2009-08-311-0/+18
| | | | | | state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Initial AMo Lint implementationYehuda Katz2009-08-291-0/+50
|
* Remove support for SQLite 2.Pratik Naik2009-08-171-9/+4
| | | | If you're still using it, please install the plugin from git://github.com/rails/sqlite2_adapter.git
* Add validates_format_of :without => /regexp/ option [Elliot Winkler, Peer Allan]Elliot Winkler2009-08-101-0/+29
| | | | | | | | | | [#430 state:resolved] Example : validates_format_of :subdomain, :without => /www|admin|mail/ Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Introduce validates_with to encapsulate attribute validations in a class.Jeff Dean2009-08-091-0/+116
| | | | | | [#2630 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix exclusive range patch to use begin/end instead of min/max. [#2981 ↵Adam Keys2009-08-081-0/+14
| | | | | | | status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Simplyfy validates_length_of and remove putsPratik Naik2009-08-081-1/+0
|
* validates_length_of with maximum should allow nil [#2309 status:resolved]jzw2009-08-081-3/+7
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Allow validations to use values from custom readers [#2936 state:resolved]James Hill2009-08-053-0/+45
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Dasherize XML root by default to avoid invalid tags ↵Joshua Peek2009-07-222-0/+15
| | | | "<admin/posts>...</admin/posts>" [#2875 state:resolved]
* Patch to ActiveModel's (and ActiveRecord, by association) XML serialization: ↵John Maxwell2009-07-221-0/+12
| | | | | | If two parameters are present in Procs supplied to to_xml's :procs option, the model being serialized will be passed as the second argument [#2373 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>