Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Nov 2, 2012
  1. @rafaelfranca

    Deprecate passing a string as third argument of `add_index`

    rafaelfranca authored
    This was there due historical reasons since
    7dc4581 to give the user the
    possibility to create unique indexes passing "UNIQUE" as the third
    argument
  2. @rafaelfranca
Commits on Oct 31, 2012
  1. @nikitug

    Fix `attributes_before_type_cast` for serialised attributes.

    nikitug authored nikitug committed
    Public method `attributes_before_type_cast` used to return internal AR structure (ActiveRecord::AttributeMethods::Serialization::Attribute), patch fixes this. Now behaves like `read_attribute_before_type_cast` and returns unserialised values.
  2. @kennyj
Commits on Oct 28, 2012
  1. @xuanxu
  2. @henrik

    Enable update_column(s) for the primary key attribute.

    henrik authored
    Didn't work before because it updated the model-in-memory first, so the DB query couldn't find the record.
  3. @senny
  4. AR::AttributeMethods#[] raises AM::AttributeMissingError for missing …

    Francesco Rodriguez authored
    …attributes.
    
    This fixes the following behaviour:
    
        class Person < ActiveRecord::Base
          belongs_to :company
        end
    
        # Before:
        person = Person.select('id').first
        person[:name]       # => nil
        person.name         # => ActiveModel::MissingAttributeError: missing_attribute: name
        person[:company_id] # => nil
        person.company      # => nil
    
        # After:
        person = Person.select('id').first
        person[:name]       # => ActiveModel::MissingAttributeError: missing_attribute: name
        person.name         # => ActiveModel::MissingAttributeError: missing_attribute: name
        person[:company_id] # => ActiveModel::MissingAttributeError: missing_attribute: company_id
        person.company      # => ActiveModel::MissingAttributeError: missing_attribute: company_id
    
    Fixes #5433.
Commits on Oct 27, 2012
  1. @pwnall
Commits on Oct 26, 2012
  1. @veader

    Decode attributes pulled from URI.parse

    veader authored
    The RFC indicates that username and passwords may be encoded.
    http://tools.ietf.org/html/rfc2396#section-3.2.2
    
    Found this trying to use the mysql://username:password@host:port/db and having special characters in the password which needed to be URI encoded.
  2. @jonleighton

    Remove ActiveRecord::Model

    jonleighton authored
    In the end I think the pain of implementing this seamlessly was not
    worth the gain provided.
    
    The intention was that it would allow plain ruby objects that might not
    live in your main application to be subclassed and have persistence
    mixed in. But I've decided that the benefit of doing that is not worth
    the amount of complexity that the implementation introduced.
Commits on Oct 24, 2012
  1. @ugisozols
Commits on Oct 20, 2012
  1. @jeremy
Commits on Oct 19, 2012
  1. @jonleighton

    Get rid of the ActiveRecord::Model::DeprecationProxy thing.

    jonleighton authored
    I think it's going to be too much pain to try to transition the
    :active_record load hook from executing against Base to executing
    against Model.
    
    For example, after Model is included in Base, and modules included in
    Model will no longer get added to the ancestors of Base.
    
    So plugins which wish to be compatible with both Model and Base should
    use the :active_record_model load hook which executes *before* Base gets
    loaded.
    
    In general, ActiveRecord::Model is an advanced feature at the moment and
    probably most people will continue to inherit from ActiveRecord::Base
    for the time being.
  2. @jonleighton

    Rename the partial_updates config to partial_writes

    jonleighton authored
    This reflects the fact that it now impact inserts as well as updates.
  3. @jonleighton
  4. @jonleighton

    Add Relation#find_or_create_by and friends

    jonleighton authored
    This is similar to #first_or_create, but slightly different and a nicer
    API. See the CHANGELOG/docs in the commit.
    
    Fixes #7853
Commits on Oct 17, 2012
  1. @scottwillson

    Fix bug with presence validation of associations.

    scottwillson authored
    Would incorrectly add duplicated errors when the association was blank. Bug introduced in 1fab518.
Commits on Oct 16, 2012
  1. @spastorino

    Merge pull request #7371 from csmuc/fix_dup_validation_errors

    spastorino authored
    Dup'ed ActiveRecord objects may not share the errors object
  2. @csmuc

    Call super to nullify the reference to the original errors object in …

    csmuc authored
    …the dup'ed object (call ActiveModel::Validations#initialize_dup). Closes #7291
Commits on Oct 15, 2012
  1. @carlosantoniodasilva
  2. @refractalize
Commits on Oct 14, 2012
  1. @arturopie

    #7914 Add change of previous commit to CHANGELOG.md

    arturopie authored arturopie committed
Commits on Oct 12, 2012
  1. @timsly
Commits on Oct 7, 2012
  1. @alexeymuranov
Commits on Oct 5, 2012
  1. @senny
Commits on Oct 4, 2012
  1. @rafaelfranca
Commits on Oct 3, 2012
  1. Count returns 0 without querying if parent is not saved

    Francesco Rodriguez authored
    Patches `CollectionAssociation#count` to return 0 without querying
    if the parent record is new. Consider the following code:
    
        class Account
          has_many :dossiers
        end
    
        class Dossier
          belongs_to :account
        end
    
        a = Account.new
        a.dossiers.build
    
        # before patch
        a.dossiers.count
        # SELECT COUNT(*) FROM "dossiers" WHERE "dossiers"."account_id" IS NULL
        # => 0
    
        # after
        a.dosiers.count # fires without sql query
        # => 0
    
    Fixes #1856.
Commits on Oct 2, 2012
  1. @lulalala

    Fix reset_counters() crashing on has_many :through associations.

    lulalala authored
    The counter column name in the intermediate model need to be access
    via the through reflection.
Commits on Sep 28, 2012
  1. @rafaelfranca
  2. @jonleighton

    Support for partial inserts.

    jonleighton authored
    When inserting new records, only the fields which have been changed
    from the defaults will actually be included in the INSERT statement.
    The other fields will be populated by the database.
    
    This is more efficient, and also means that it will be safe to
    remove database columns without getting subsequent errors in running
    app processes (so long as the code in those processes doesn't
    contain any references to the removed column).
  3. @smartinez87
Commits on Sep 23, 2012
  1. Add CHANGELOG entry and update the guide

    John Foley authored
Commits on Sep 21, 2012
  1. @spastorino

    Revert "Fix find_in_batches with customized primary_key"

    spastorino authored
    This reverts commit 761bc75.
    
    This commit wasn't fixing any issue just using the same table for
    different models with different primary keys.
Something went wrong with that request. Please try again.