aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
* changelog updates for Rails 4 [ci skip]Vijay Dev2012-03-091-0/+2
|
* Add ActiveModel::Model, a mixin to make Ruby objects to work with AP inmediatlyGuillermo Iguaran2012-03-021-0/+2
|
* Add release dates to documentationclaudiob2012-03-011-1/+1
| | | | Set "March 1, 2012" as the release date for 3.2.2, 3.1.4, 3.0.12
* Update changelogs with rails 3.0-stable branch infoPaco Guzman2012-02-251-1/+47
|
* AM::Errors: allow :full_messages parameter for #as_jsonBogdan Gusiev2012-02-201-0/+2
|
* Trim down Active Model API by removing valid? and errors.full_messagesJosé Valim2012-02-071-0/+2
|
* Add release date of Rails 3.2.0 to documentationclaudiob2012-01-261-1/+1
|
* Revert "Implement ArraySerializer and move old serialization API to a new ↵José Valim2011-11-301-8/+0
| | | | | | | | | | | | | namespace." This reverts commit 8896b4fdc8a543157cdf4dfc378607ebf6c10ab0. Conflicts: activemodel/lib/active_model.rb activemodel/lib/active_model/serializable.rb activemodel/lib/active_model/serializer.rb activemodel/test/cases/serializer_test.rb
* Deprecated `define_attr_method` in `ActiveModel::AttributeMethods`Jon Leighton2011-11-291-0/+5
| | | | | This only existed to support methods like `set_table_name` in Active Record, which are themselves being deprecated.
* Revert the serializers API as other alternatives are now also under discussionJosé Valim2011-11-251-2/+0
|
* Add docs to serializers. Update CHANGELOGs.José Valim2011-11-251-1/+13
|
* Convert CHANGELOGs to Markdown format.Jon Leighton2011-11-041-0/+109
Reasons: * Markdown reads well as plain text, but can also be formatted. * It will make it easier for people to read on the web as Github formats the Markdown nicely. * It will encourage a level of consistency when people are writing CHANGELOG entries. The script used to perform the conversion is at https://gist.github.com/1339263