aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
Commit message (Collapse)AuthorAgeFilesLines
* ruby 2.0 makes protected methods return false for respond_to, so pass true ↵Aaron Patterson2012-02-211-1/+1
| | | | as the second param
* AM::Errors: allow :full_messages parameter for #as_jsonBogdan Gusiev2012-02-201-3/+14
|
* Fix sanitize_for_mass_assigment when role is nilFabio Yamate2012-02-151-3/+3
| | | | | | | There is an example in Rails documentation that suggests implementing assign_attributes method for ActiveModel interface, that by default sends option role with nil. Since mass_assignment_authorizer never is called without args, we can move the default value internally.
* remove unnecessary require core_ext/string/encodingSergey Nartimov2012-02-141-2/+0
|
* Merge pull request #5018 from hammerdr/issue-4659-docsAaron Patterson2012-02-131-4/+7
|\ | | | | Adding documentation to clarify usage of attributes hash.
| * Missed a code example. Fixing the docs to be consistant.Derek Hammer2012-02-121-1/+1
| |
| * Adding documentation to clarify usage of attributes hash.Derek Hammer2012-02-121-3/+6
| | | | | | | | | | | | Serialization uses only the attributes hash's keys and calls methods that are of the same name as the keys on the serialized object.
* | Make sure serializable hash with :methods option returns always string keysCarlos Antonio da Silva2012-02-131-1/+1
|/
* Merge pull request #4930 from ask4prasath/ordered_hash_replacedAaron Patterson2012-02-082-5/+4
|\ | | | | Replacing ordered hash to ruby hash on active model
| * replacing ordered hash to ruby hashprasath2012-02-082-5/+4
| |
* | Trim down Active Model API by removing valid? and errors.full_messagesJosé Valim2012-02-071-27/+13
|/
* To infinity… and beyond!Niels Ganser2012-02-061-2/+2
| | | | | | | Allow infinite values for validates_length_of. Particularly useful for prettily defining an open ended range such as validates_length_of :human_stupidity, :within => 0..Float::INFINITY
* AS::Callbacks: :skip_after_callbacks_if_terminated optionBogdan Gusiev2012-02-032-3/+3
|
* revise docs [ci skip]Vijay Dev2012-02-011-3/+3
|
* Generate strict validation error messages with attribute nameCarlos Antonio da Silva2012-02-012-8/+7
|
* fix example code in documentation for has_secure_passwordAaron Beckerman2012-01-281-1/+1
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-01-261-1/+1
|\
| * Fix translate_error reference for Error#add documentationJonathan del Strother2012-01-251-1/+1
| |
* | quote fix ` to ' in the ArgumentError messageManoj2012-01-241-1/+1
|/ | | | message quote fix
* remove unused capturesAaron Patterson2012-01-191-2/+2
|
* whitespacesdreamfall2012-01-171-3/+3
|
* validates method should not change options argumentdreamfall2012-01-171-1/+1
|
* Remove redundant #to_symPaweł Kondzior2012-01-161-1/+1
|
* Fix ActiveModel::Errors#dupPaweł Kondzior2012-01-161-0/+5
| | | | | | | | | Since ActiveModel::Errors instance keeps all error messages as hash we should duplicate this object as well. Previously ActiveModel::Errors was a subclass of ActiveSupport::OrderedHash, which results in different behavior on `dup`, this may result in regression for people relying on it.
* Add ActiveModel::Errors#delete, which was not available after move to use ↵Piotr Sarnacki2012-01-161-0/+5
| | | | delegation
* Fix stack level too deep when model does not have attributes method.Piotr Sarnacki2012-01-151-1/+1
| | | | | | | | | | | Without that patch when using ActiveModel::AttributeMethods in a class that does not respond to `attributes` method, stack level too deep error will be raised on non existing method. While documentation is clear that you need to define `attributes` method in order to use AttributeMethods module, `stack level too deep` is rather obscure and hard to debug, therefore we should try to not break `method_missing` if someone forgets about defining `attributes`.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-01-111-1/+1
|\
| * Update ConfirmationValidator docs, correct when the validator runsAlan Harper2012-01-051-1/+1
| |
* | removed unnessary require active_support/core_ext/array_wrapKarunakar (Ruby)2012-01-061-1/+0
| |
* | Revert "Revert "More 1.9 way""Santiago Pastorino2012-01-061-4/+2
| | | | | | | | | | Fixed failing tests This reverts commit 8350ce97f2065eed9638c595d3938a573d6fa343.
* | Remove Array.wrap call in ActiveModelRafael Mendonça França2012-01-067-17/+12
| |
* | Revert "More 1.9 way"Aaron Patterson2012-01-051-2/+4
| | | | | | | | This reverts commit 675094b2757cf90399dadca4489b1036810ae570.
* | More 1.9 waySantiago Pastorino2012-01-051-4/+2
| |
* | use logger.warn for warningsAaron Patterson2012-01-041-1/+1
| |
* | push exception message formatting to the exception classAaron Patterson2012-01-041-1/+4
| |
* | push target down to the classes that care about itAaron Patterson2012-01-041-4/+5
| |
* | just implement the delegate methodAaron Patterson2012-01-041-4/+4
| |
* | Array.wrap no longer neededAaron Patterson2012-01-041-3/+2
|/
* Fix grammatical error in ↵Steve Richert2012-01-021-1/+1
| | | | ActiveModel::MassAssignmentSecurity::PermissionSet#deny? NotImplementedError message
* Support configuration on ActiveRecord::Model.Jon Leighton2011-12-285-14/+153
| | | | | | | | | | | | | | | The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present.
* Merge pull request #4172 from nashby/refactor-tokenizerJosé Valim2011-12-241-4/+2
|\ | | | | don't call an extra method if options[:tokenizer] is not present
| * don't call an extra method if options[:tokenizer] is not presentVasiliy Ermolovich2011-12-241-4/+2
| |
* | remove deprecated define_attr_method from ActiveModel::AttributeMethodsSergey Nartimov2011-12-241-41/+0
|/
* use Range#min and Range#max to reduce extra statementVasiliy Ermolovich2011-12-241-2/+1
|
* deprecate String#encoding_aware? and remove its usageSergey Nartimov2011-12-241-2/+0
|
* AM::MAS.attr_protected: rework usage example.Bogdan Gusiev2011-12-231-9/+9
|
* Fixed AM::MasAsSec.attr_protected usage example. Bogdan Gusiev2011-12-221-15/+16
| | | | | | | | Problems with current example: * DOESN'T WORK ** attr_protected :last_login, :as => :admin # doesn't make it accessible for admin * Uses ActiveSupport Fixnum extension
* Fix AM::MassAssignementSecurity docBogdan Gusiev2011-12-221-1/+1
|
* added :other_than => :!= option to numericality validatorJakub Kuźma2011-12-212-2/+4
|
* Remove dead code from AMo.José Valim2011-12-201-12/+0
|