aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
* Fix secure_password password_confirmation validationsVladimir Kiselev2013-07-241-0/+5
|
* Merge pull request #10774 from ↵Carlos Antonio da Silva2013-06-251-0/+9
|\ | | | | | | | | | | | | | | chuckbergeron/validates-inclusion-of-accuracy-for-non-numeric-ranges Greater accuracy for validates_inclusion_of on non-numeric ranges Closes #10774, fixes #10593
| * Use Range#cover? for Numeric ranges (tests via endpoints) and use ↵Charles Bergeron2013-05-271-0/+4
| | | | | | | | | | | | Range#include? for non-numeric ranges added changelog message
* | Fix regression in has_secure_password.Phil Calvin2013-05-301-0/+5
|/ | | | If the confirmation was blank, but the password wasn't, it would still save.
* deprecate Validator#setup (to get rid of a respond_to call). validators do ↵Nick Sutterer2013-05-231-1/+3
| | | | their setup in their constructor now.
* rails/master is now 4.1.0.betaRafael Mendonça França2013-04-291-212/+2
|
* use unified and clean formatting in CHANGELOGS. [ci skip]Yves Senn2013-04-121-9/+12
|
* Improve changelog entry for ActiveModel::Errors#full_messages_for [ci skip]Carlos Antonio da Silva2013-03-301-2/+13
| | | | Add a working example of how to use this new method.
* Add a method full_messages_for to the Errors classshock_one2013-03-241-0/+5
|
* Fixed typo in activemodel/CHANGELOGPrathamesh Sonpatki2013-03-241-1/+1
|
* The repair_validations helper was not working correctly before becausewangjohn2013-03-191-0/+21
| | | | | | it only cleared the validations that created :validate callbacks. This didn't include the validates created by validates_with, so I've added a method to clear all validations.
* Small typos here and there.Vipul A M2013-03-151-1/+1
|
* Fix AMo code example indent, add missing author to entry [ci skip]Carlos Antonio da Silva2013-03-091-6/+8
|
* `has_secure_password` is not invalid when assigning empty Strings.Yves Senn2013-03-041-0/+10
| | | | | | | | | | Closes #9535. With 692b3b6 the `password=` setter does no longer set blank passwords. This triggered validation errors when assigning empty Strings to `password` and `password_confirmation`. This patch only sets the confirmation if it is not `blank?`.
* `validates_confirmation_of` does not override writer methods.Yves Senn2013-03-041-0/+15
|
* Update CHANGELOGSRafael Mendonça França2013-02-261-0/+3
|
* Preparing for 4.0.0.beta1 releaseDavid Heinemeier Hansson2013-02-251-1/+1
|
* did a pass over the AM changelog [ci skip]Xavier Noria2013-02-241-15/+35
|
* This change doesn't need a CHANGELOG entry.Rafael Mendonça França2012-12-261-5/+0
| | | | [ci skip]
* Add CHANGELOG entry for #8622Rafael Mendonça França2012-12-261-0/+5
|
* Remove CHANGELOG entry for ActiveModel::Errors#add_on_presentRafael Mendonça França2012-12-211-5/+0
|
* Fix Action Mailer changelog indenation to match other changelogsCarlos Antonio da Silva2012-12-191-0/+1
| | | | Also some minor improvements to other changelogs. [ci skip]
* Improve AMo changelog example to not rely on AR [ci skip]Carlos Antonio da Silva2012-12-191-4/+8
|
* Add `ActiveModel::Validations::AbsenceValidator`, a validator to check the ↵Roberto Vasquez Angel2012-12-151-0/+19
| | | | | | absence of attributes. Add `ActiveModel::Errors#add_on_present` method. Adds error messages to present attributes.
* Convert changelogs to 1.9 hash style and fix some formatting [ci skip]Carlos Antonio da Silva2012-12-141-1/+1
|
* Reset attributes should not report changes.Renato Mascarenhas2012-12-011-0/+4
| | | | | | | | | | | When resetting an attribute, you expect it to return to the state it was before any changes. Namely, this fixes this unexpected behavior: ~~~ruby model.name = "Bob" model.reset_name! model.name_changed? #=> true ~~~
* Add CHANGELOG entries for the observes extractionRafael Mendonça França2012-11-291-0/+4
| | | | [ci skip]
* Specify type of singular association during serializationSteve Klabnik2012-11-281-0/+2
| | | | | | | | | | | | When serialising a class, specify the type of any singular associations, if necessary. Rails already correctly specifies the :type of any enumerable association (e.g. a has_many association), but made no attempt to do so for non-enumerables (e.g. a has_one association). We must specify the :type of any STI association. A has_one association to a class which uses single-table inheritance is an example of this type of association. Fixes #7471
* Merge pull request #7282 from xHire/validates_length_of_fixRafael Mendonça França2012-11-261-0/+4
|\ | | | | | | | | | | | | Length validation handles correctly nil. Fix #7180 Conflicts: activemodel/CHANGELOG.md
| * Length validation handles correctly nil. Fix #7180Michal Zima2012-11-261-0/+4
| | | | | | | | When nil or empty string are not allowed, they are not valid.
* | cleanup, removed dispensable `require` statements from `ActiveModel`Yves Senn2012-11-251-0/+5
|/
* Use BCrypt's MIN_COST in the test environment for speedier testsTrevor Turk2012-11-141-0/+4
|
* add credit to committer of pull request #6569Jan Berdajs2012-10-181-1/+1
|
* Revert "Merge pull request #7826 from sikachu/master-validators-kind"Rafael Mendonça França2012-10-021-10/+0
| | | | | | | | | | | | | | | | 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.
* Make `.validators_on` accept `:kind` optionPrem Sichanugrist2012-10-021-0/+10
| | | | | This will filter out the validators on a particular attribute based on its kind.
* Update changelogs to add entries about strong_parameters integrationGuillermo Iguaran2012-09-191-0/+11
|
* Update Active Model xml serialization test to reflect a change in builderCarlos Antonio da Silva2012-09-071-0/+11
| | | | | | | | | | | | | | Due to a change in builder, nil values and empty strings now generates closed tags, so instead of this: <pseudonyms nil=\"true\"></pseudonyms> It generates this: <pseudonyms nil=\"true\"/> Document this change in Rails so that people can track it down easily if necessary.
* CHANGELOGs are now per branchXavier Noria2012-08-281-205/+1
| | | | | | | | | | Changes in old branches needed to be manually synched in CHANGELOGs of newer ones. This has proven to be brittle, sometimes one just forgets this manual step. With this commit we switch to CHANGELOGs per branch. When a new major version is cut from master, the CHANGELOGs in master start being blank. A link to the CHANGELOG of the previous branch allows anyone interested to follow the history.
* Accept a symbol for `:in` option on inclusion and exclusion validatorsGabriel Sobrinho2012-08-241-0/+6
|
* Merge pull request #7024 from bogdan/strict_validation_custom_exceptionRafael Mendonça França2012-08-161-1/+10
|\ | | | | | | | | | | | | 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-061-0/+2
| |
* | Following the false issue reporting I did here : ↵Anthony2012-08-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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
* | Sync CHANGELOGs [ci skip]Rafael Mendonça França2012-08-111-0/+14
|/
* prevent users from unknowingly using bad regexps that can compromise ↵MrBrdo2012-06-141-0/+5
| | | | security (http://homakov.blogspot.co.uk/2012/05/saferweb-injects-in-various-ruby.html)
* change AMS::JSON.include_root_in_json default value to falseFrancesco Rodriguez2012-06-061-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: * Update `include_root_in_json` default value to false for default value to false for `ActiveModel::Serializers::JSON`. * Remove unnecessary change to include_root_in_json option in wrap_parameters template. * Update `as_json` documentation. * Fix JSONSerialization tests. Problem: It's confusing that AM serializers behave differently from AR, even when AR objects include AM serializers module. class User < ActiveRecord::Base; end class Person include ActiveModel::Model include ActiveModel::AttributeMethods include ActiveModel::Serializers::JSON attr_accessor :name, :age def attributes instance_values end end user.as_json => {"id"=>1, "name"=>"Konata Izumi", "age"=>16, "awesome"=>true} # root is not included person.as_json => {"person"=>{"name"=>"Francesco", "age"=>22}} # root is included ActiveRecord::Base.include_root_in_json => false Person.include_root_in_json => true # different default values for include_root_in_json Proposal: Change the default value of AM serializers to false, update the misleading documentation and remove unnecessary change to false of include_root_in_json option with AR objects. class User < ActiveRecord::Base; end class Person include ActiveModel::Model include ActiveModel::AttributeMethods include ActiveModel::Serializers::JSON attr_accessor :name, :age def attributes instance_values end end user.as_json => {"id"=>1, "name"=>"Konata Izumi", "age"=>16, "awesome"=>true} # root is not included person.as_json => {"name"=>"Francesco", "age"=>22} # root is not included ActiveRecord::Base.include_root_in_json => false Person.include_root_in_json => false # same behaviour, more consistent Fixes #6578.
* Sync CHANGLOG with the 3-2-stable branchRafael Mendonça França2012-06-011-0/+15
|
* Don't enable validations when passing false hash values to ActiveModel.validatesSteve Purcell2012-05-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing a falsey option value for a validator currently causes that validator to be enabled, just like "true": ActiveModel.validates :foo, :presence => false This is rather counterintuitive, and makes it inconvenient to wrap `validates` in methods which may conditionally enable different validators. As an example, one is currently forced to write: def has_slug(source_field, options={:unique => true}) slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? } before_validation slugger validations = { :presence => true, :slug => true } if options[:unique] validations[:uniqueness] = true end validates :slug, validations end because the following reasonable-looking alternative fails to work as expected: def has_slug(source_field, options={:unique => true}) slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? } before_validation slugger validates :slug, :presence => true, :slug => true, :uniqueness => options[:unique] end (This commit includes a test, and all activemodel and activerecord tests pass as before.)
* Reordered changelog entryBrian Cardarella2012-04-231-2/+2
|
* Updated CHANGELOGBrian Cardarella2012-04-231-0/+2
|
* Fix my name in the CHANGELOG to follow the conventionRafael Mendonça França2012-03-091-0/+11
| | | | Also add missing entries and use the formating convention