aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/models
Commit message (Collapse)AuthorAgeFilesLines
* Convert ActiveModel to 1.9 hash syntax.Patrick Robertson2013-05-013-6/+6
| | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
* test for ActiveModel::Conversion#to_partial_path and namespaced modelsYves Senn2013-01-141-0/+4
|
* Remove observers and sweepersRafael Mendonça França2012-11-281-27/+0
| | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
* fix failing isolated testsFrancesco Rodriguez2012-10-261-0/+1
|
* AM::Serializers::Xml depends on AM::NamingFrancesco Rodriguez2012-10-261-1/+0
|
* attr_accessible and attr_protected raise an exception pointing to use plugin ↵Guillermo Iguaran2012-09-161-0/+3
| | | | or new protection model
* Remove MassAssignmentSecurity from ActiveModelGuillermo Iguaran2012-09-164-88/+7
| | | | This will be moved out to protected_attributes gem
* Integrate ActiveModel::ForbiddenAttributesProtection from StrongParameters gemGuillermo Iguaran2012-09-161-0/+7
|
* has_secure_password should not raise a 'digest missing' error if the calling ↵Robby Grossman2012-07-311-0/+11
| | | | class has specified for validations to be skipped.
* Updated tests for has_secure_password.Erich Menge2012-05-083-2/+11
|
* Rely on a public contract between railties instead of accessing railtie ↵José Valim2011-11-231-6/+2
| | | | methods directly.
* Let ActiveModel instances define partial paths.Grant Hutchins & Peter Jaros2011-07-251-0/+3
| | | | | | Deprecate ActiveModel::Name#partial_path. Now you should call #to_path directly on ActiveModel instances.
* Allow to specify mass-assignment roles as arrayAlexander Uvarov2011-06-231-1/+9
|
* Methods that return nil should not be considered YAMLJoshua Wehner2011-05-101-0/+4
|
* Allow observers to be enabled and disabled.Myron Marston2011-04-281-0/+27
| | | | This is useful in situations like model unit tests and the occasional rake task to backfill old data.
* AM mass assignment security attr_accessible and attr_protected now allow for ↵Josh Kalderimis2011-04-241-0/+11
| | | | | | | | scopes using :as => scope eg. attr_accessible :name attr_accessible :name, :admin, :as => :admin
* Revert "Properly interpolate i18n keys in modules [#5572 state:resolved]"Santiago Pastorino2011-02-271-5/+0
| | | | | | | This breaks #6448, you should use :"module/class" as key for namespacing [#6448 state:committed] This reverts commit 8d30193b08bd2321a7a78a1f481bd5e4d4d45557.
* failing test for i18n key collision with namespaced modelsSantiago Pastorino2011-02-271-0/+4
|
* Override attributes_protected_by_default when has_secure_password is called.Tsutomu Kuroda2011-02-092-0/+19
| | | | | | | attr_protected should not be called, because it nullifies the mass assignment protection that has been set by attr_accessible. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Optionally pass in the attribute being validated to an instance method validatorCarl Lerche2011-02-051-0/+4
|
* Be able to pass a validator method to #validatesCarl Lerche2011-02-051-0/+4
|
* Provide a way to specify alternate option keys for validatesCarl Lerche2011-02-051-0/+4
|
* Added ActiveRecord::Base#has_secure_password (via ↵David Heinemeier Hansson2010-12-181-0/+8
| | | | ActiveModel::SecurePassword) to encapsulate dead-simple password usage with SHA2 encryption and salting
* No need to pass self as parameter here.José Valim2010-10-041-1/+1
|
* Test to_model being called in ActiveModel::Naming helpersErnie Miller2010-10-041-0/+7
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Properly interpolate i18n keys in modules [#5572 state:resolved]Rodrigo Rosenfeld Rosas2010-09-241-0/+5
|
* Better shortcut options for custom validators [#5672 state:resolved]Obie Fernandez2010-09-241-0/+13
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Prepared ActiveModel::Naming to handle cases for namespaced isolated enginesPiotr Sarnacki2010-09-031-0/+13
|
* after_validation should be called irrespective of the result of validation.Neeraj Singh2010-08-201-0/+9
| | | | | | | | I confirmed that this is the behavior on 2.3.x . [5419 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-143-4/+3
| | | | 's/[ \t]*$//' -i {} \;)
* Reuse already existing classes for ActiveModel tests.José Valim2010-07-212-0/+5
|
* mass_assignment_security moved from AR to AMo, and minor test cleanupJosh Kalderimis2010-07-081-0/+57
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* validation macros can now be used within an instanceJosh Kalderimis2010-05-131-0/+12
|
* removed an old unused model in the AMo tests which also removes another AR ↵Josh Kalderimis2010-05-091-6/+0
| | | | dependency
* removed use of AR in AMo tests and removed testing of scopes (:on) in ↵Josh Kalderimis2010-05-082-10/+18
| | | | individual validation tests and moved them to their own test file
* test cases for record.to_xml [#458 state:resolved]Neeraj Singh2010-04-301-0/+8
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix AMo isolated tests.José Valim2010-02-221-1/+1
|
* Require persisted? in ActiveModel::Lint and remove new_record? and ↵José Valim2010-02-211-3/+3
| | | | destroyed? methods. ActionPack does not care if the resource is new or if it was destroyed, it cares only if it's persisted somewhere or not.
* Add to_key and to_param methods to ActiveModel::Conversion.José Valim2010-02-211-1/+7
|
* Fix typo by renaming :genre to :gender.José Valim2010-01-091-1/+1
|
* Allow validates to map some types to specific options. So now you can do:José Valim2010-01-081-1/+1
| | | | | | validates :email, :presence => true, :format => /@/ validates :genre, :inclusion => %w(m f) validates :password, :length => 6..20
* Allow :if, :unless, :on, :allow_nil and :allow_blank as shared options in ↵José Valim2010-01-071-0/+4
| | | | validates.
* Add validates method as shortcut to setup validators for a given set of ↵jamie2010-01-072-2/+11
| | | | | | | | | | | | | | | 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>
* No need to use ValidationsRepairHelper hack on ActiveModel anymore, ↵José Valim2009-12-231-1/+1
| | | | 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-232-0/+8
|
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-081-3/+3
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Allow validations to use values from custom readers [#2936 state:resolved]James Hill2009-08-051-0/+17
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Dasherize XML root by default to avoid invalid tags ↵Joshua Peek2009-07-221-0/+4
| | | | "<admin/posts>...</admin/posts>" [#2875 state:resolved]
* Initial extraction of AMo xml serializerJoshua Peek2009-07-031-0/+3
|
* Deprecate Model#validate/validate_on_create/validate_on_update. Use ↵Pratik Naik2009-03-211-3/+7
| | | | Model.validate :method and likewise