Skip to content
This repository

May 28, 2012

  1. Steve Purcell

    Don't enable validations when passing false hash values to ActiveMode…

    …l.validates
    
    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.)
    authored May 28, 2012

Apr 24, 2012

  1. Brian Cardarella

    Reordered changelog entry

    authored April 23, 2012
  2. Brian Cardarella

    Updated CHANGELOG

    authored April 23, 2012

Mar 09, 2012

  1. Rafael Mendonça França

    Fix my name in the CHANGELOG to follow the convention

    Also add missing entries and use the formating convention
    authored March 09, 2012

Mar 08, 2012

  1. Vijay Dev

    changelog updates for Rails 4 [ci skip]

    authored March 09, 2012

Mar 03, 2012

  1. Guillermo Iguaran

    Add ActiveModel::Model, a mixin to make Ruby objects to work with AP …

    …inmediatly

Mar 01, 2012

  1. Claudio B.

    Add release dates to documentation

    Set "March 1, 2012" as the release date for 3.2.2, 3.1.4, 3.0.12
    authored March 01, 2012

Feb 25, 2012

  1. Paco Guzmán

    Update changelogs with rails 3.0-stable branch info

    authored December 18, 2011 pacoguzman committed February 25, 2012

Feb 20, 2012

  1. Bogdan Gusiev

    AM::Errors: allow :full_messages parameter for #as_json

    authored February 17, 2012

Feb 07, 2012

  1. José Valim

    Trim down Active Model API by removing valid? and errors.full_messages

    authored February 07, 2012

Jan 26, 2012

  1. Claudio B.

    Add release date of Rails 3.2.0 to documentation

    authored January 26, 2012

Nov 30, 2011

  1. José Valim

    Revert "Implement ArraySerializer and move old serialization API to a…

    … new namespace."
    
    This reverts commit 8896b4f.
    
    Conflicts:
    
    	activemodel/lib/active_model.rb
    	activemodel/lib/active_model/serializable.rb
    	activemodel/lib/active_model/serializer.rb
    	activemodel/test/cases/serializer_test.rb
    authored November 30, 2011

Nov 29, 2011

  1. Jon Leighton

    Deprecated `define_attr_method` in `ActiveModel::AttributeMethods`

    This only existed to support methods like `set_table_name` in Active
    Record, which are themselves being deprecated.
    authored November 29, 2011

Nov 25, 2011

  1. José Valim

    Revert the serializers API as other alternatives are now also under d…

    …iscussion
    authored November 25, 2011
  2. José Valim

    Add docs to serializers. Update CHANGELOGs.

    authored November 25, 2011

Nov 04, 2011

  1. Jon Leighton

    Convert CHANGELOGs to Markdown format.

    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
    authored November 04, 2011
Something went wrong with that request. Please try again.