aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
Commit message (Collapse)AuthorAgeFilesLines
* Use the `flat_map` method.Rafael Mendonça França2012-10-031-2/+2
| | | | Thanks to @jeremy to teach me this one.
* Revert "Merge pull request #7826 from sikachu/master-validators-kind"Rafael Mendonça França2012-10-021-14/+1
| | | | | | | | | | | | | | | | This reverts commit 4e9f53f9736544f070e75e516c71137b7eb49a7a, reversing changes made to 6b802cdb4f5b84e1bf49aaeb0e994b3be6028af9. Revert "Don't use tap in this case." This reverts commit 454d820bf0a18fe1db4c55b0145197d70fef1f82. Reason: Is not a good idea to add options to this method since we can do the same thing using method composition. Person.validators_on(:name).select { |v| v.kind == :presence } Also it avoids to change the method again to add more options.
* Don't use tap in this case.Rafael Mendonça França2012-10-021-5/+7
| | | | | The use of tap in this case is very confusing since we are mutating the return value inside the block
* Make `.validators_on` accept `:kind` optionPrem Sichanugrist2012-10-021-1/+12
| | | | | This will filter out the validators on a particular attribute based on its kind.
* Switch to using include? on validation callbacksJohn Foley2012-09-231-2/+2
|
* Fix collisions with before and after validation callbacks.John Foley2012-09-231-2/+6
| | | | | | This commit allows a user to do something like: before_validation :do_stuff, :on => [ :create, :update ] after_validation :do_more, :on => [ :create, :update ]
* add :nodoc: to AMo::DeprecatedMassAssignmentSecurity::ClassMethods [ci skip]Francesco Rodriguez2012-09-201-3/+3
|
* change AMo::ForbiddenAttributesProtection#sanitize_for_mass_assignment to ↵Francesco Rodriguez2012-09-201-7/+8
| | | | protected
* update AMo::ForbiddenAttributesError documentation [ci skip]Francesco Rodriguez2012-09-201-0/+12
|
* add :nodoc: directives to AMo::DeprecatedMassAssignmentSecurity [ci skip]Francesco Rodriguez2012-09-201-3/+3
|
* attr_accessible and attr_protected raise an exception pointing to use plugin ↵Guillermo Iguaran2012-09-161-0/+19
| | | | or new protection model
* Rename ForbiddenAttributes exception to ForbiddenAttributesErrorGuillermo Iguaran2012-09-161-2/+2
|
* Remove MassAssignmentSecurity from ActiveModelGuillermo Iguaran2012-09-164-468/+4
| | | | This will be moved out to protected_attributes gem
* Integrate ActiveModel::ForbiddenAttributesProtection from StrongParameters gemGuillermo Iguaran2012-09-161-0/+14
|
* remove '.rb' from require callNihad Abbasov2012-09-121-1/+1
|
* Added forgotten :message option to ActiveModel validates documentationAnatoly Makarevich2012-09-071-3/+3
|
* Accept a symbol for `:in` option on inclusion and exclusion validatorsGabriel Sobrinho2012-08-243-5/+14
|
* Get rid of config.preload_frameworks in favor of config.eager_load_namespacesJosé Valim2012-08-211-1/+7
| | | | | | | The new option allows any Ruby namespace to be registered and set up for eager load. We are effectively exposing the structure existing in Rails since v3.0 for all developers in order to make their applications thread-safe and CoW friendly.
* Merge pull request #7024 from bogdan/strict_validation_custom_exceptionRafael Mendonça França2012-08-162-4/+11
|\ | | | | | | | | | | | | AM::Validation#validates: custom exception for :strict option Conflicts: activemodel/CHANGELOG.md
| * AM::Validation#validates: ability to pass custom exception to `:strict` optionBogdan Gusiev2012-08-062-4/+11
| |
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-08-161-0/+11
|\ \
| * | add around_create callback documentation for ActiveModel::Callbacksandrea longhi2012-08-081-0/+11
| | |
* | | Following the false issue reporting I did here : ↵Anthony2012-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/rails/rails/issues/6958 - Enable propagation of :skip_types, :dasherize and :camelize on included models by default - Adding the option to override this propagation on a per-include basis (:include => { :model => { :dasherize => false } } - Enough tests to prove it works - Updated activemodel CHANGELOG.md Squashed my commits
* | | Refactor model name logic and make it a real private class methodCarlos Antonio da Silva2012-08-111-5/+8
| | | | | | | | | | | | | | | | | | | | | Under a "private" call, class methods are not real private methods, they're public just like any other method. Make model_name_from_record_or_class a private class method, and nodoc it.
* | | Naming helpers should first check if passed object responds to model_nameBert Goethals2012-08-081-5/+3
| |/ |/|
* | removes usage of Object#in? from the code base (the method remains defined ↵Xavier Noria2012-08-061-1/+1
|/ | | | | | | | | | | | | | | | | | | by Active Support) Selecting which key extensions to include in active_support/rails made apparent the systematic usage of Object#in? in the code base. After some discussion in https://github.com/rails/rails/commit/5ea6b0df9a36d033f21b52049426257a4637028d we decided to remove it and use plain Ruby, which seems enough for this particular idiom. In this commit the refactor has been made case by case. Sometimes include? is the natural alternative, others a simple || is the way you actually spell the condition in your head, others a case statement seems more appropriate. I have chosen the one I liked the most in each case.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-08-0415-278/+765
|\ | | | | | | | | | | Conflicts: activemodel/lib/active_model/secure_password.rb activerecord/lib/active_record/associations/collection_proxy.rb
| * copy edits [ci skip]Vijay Dev2012-08-041-1/+1
| |
| * Fix ActiveModel::Serializers::Xml#to_xml referenceRobert Pankowecki2012-08-021-1/+1
| | | | | | | | Link to ActiveRecord::Serialization#to_xml for more details
| * update ActiveModel::Observer documentation [ci skip]Francesco Rodriguez2012-07-311-21/+32
| |
| * update ActiveModel::ObserverArray documentation [ci skip]Francesco Rodriguez2012-07-301-3/+4
| |
| * add :nodoc: to ActiveModel::Observing#inherited [ci skip]Francesco Rodriguez2012-07-301-1/+1
| |
| * update ActiveModel::Observing documentation [ci skip]Francesco Rodriguez2012-07-301-25/+125
| |
| * update ActiveModel::Serializers documentation [ci skip]Francesco Rodriguez2012-07-302-14/+40
| |
| * add documentation to ActiveModel #from_json method [ci skip]Francesco Rodriguez2012-07-301-2/+34
| |
| * fix #after_validation example [ci skip]Francesco Rodriguez2012-07-301-1/+1
| |
| * add :nodoc: directives to ActiveModel Sanitizers [ci skip]Francesco Rodriguez2012-07-291-4/+4
| |
| * fix class reference in AM::MassAssignmentSecurity documentation [ci skip]Francesco Rodriguez2012-07-291-3/+3
| |
| * update ActiveModel::Validations::Callbacks documentation [ci skip]Francesco Rodriguez2012-07-291-18/+69
| |
| * update #validates and #validates! documentation [ci skip]Francesco Rodriguez2012-07-291-31/+43
| |
| * update ActiveModel::Valdations#validates_with docs [ci skip]Francesco Rodriguez2012-07-291-16/+18
| |
| * update ActiveModel::Validations docs [ci skip]Francesco Rodriguez2012-07-292-36/+127
| |
| * update ActiveModel::Validator docs [ci skip]Francesco Rodriguez2012-07-292-11/+11
| |
| * update ActiveModel::SecurePassword docs [ci skip]Francesco Rodriguez2012-07-291-18/+38
| |
| * add example to ActiveModel::StrictValidationFailed [ci skip]Francesco Rodriguez2012-07-281-0/+13
| |
| * add example to ActiveModel::MissingAttributeError [ci skip]Francesco Rodriguez2012-07-281-0/+8
| |
| * update ActiveModel::MassAssignmentSecurity docs [ci skip]Francesco Rodriguez2012-07-281-65/+177
| |
| * add example to ActiveModel::Naming#model_name [ci skip]Francesco Rodriguez2012-07-271-0/+8
| |
| * fix AM::Naming examples [ci skip]Francesco Rodriguez2012-07-271-12/+12
| |
| * add :nodoc: directive to AM::ObserverArray internal methods [ci skip]Francesco Rodriguez2012-07-221-10/+10
| |