Commits on Oct 2, 2012
  1. Fix reset_counters() crashing on has_many :through associations.

    lulalala committed Oct 2, 2012
    The counter column name in the intermediate model need to be access
    via the through reflection.
Commits on Sep 28, 2012
  1. Support for partial inserts.

    jonleighton committed Sep 28, 2012
    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).
Commits on Sep 23, 2012
  1. Add CHANGELOG entry and update the guide

    John Foley
    John Foley committed Sep 23, 2012
Commits on Sep 21, 2012
  1. Revert "Fix find_in_batches with customized primary_key"

    spastorino committed Sep 21, 2012
    This reverts commit 761bc75.
    This commit wasn't fixing any issue just using the same table for
    different models with different primary keys.
  2. Support for specifying transaction isolation level

    jonleighton committed Sep 21, 2012
    If your database supports setting the isolation level for a transaction,
    you can set it like so:
      Post.transaction(isolation: :serializable) do
        # ...
    Valid isolation levels are:
    * `:read_uncommitted`
    * `:read_committed`
    * `:repeatable_read`
    * `:serializable`
    You should consult the documentation for your database to understand the
    semantics of these different levels:
    An `ActiveRecord::TransactionIsolationError` will be raised if:
    * The adapter does not support setting the isolation level
    * You are joining an existing open transaction
    * You are creating a nested (savepoint) transaction
    The mysql, mysql2 and postgresql adapters support setting the
    transaction isolation level. However, support is disabled for mysql
    versions below 5, because they are affected by a bug
    ( which means the isolation level
    gets persisted outside the transaction.
Commits on Sep 20, 2012
  1. rename AR::Model::Tag to AR::Tag - fixes #7714

    Francesco Rodriguez
    Francesco Rodriguez committed Sep 20, 2012
Commits on Sep 19, 2012
  1. fix querying with an empty hash

    dmathieu committed Jul 5, 2012
    Closes #6960
Commits on Sep 18, 2012
  1. ActiveRecord -> Active Record

    fxn committed Sep 18, 2012
Commits on Sep 17, 2012
  1. Merge pull request #7661 from ernie/build-join-records-on-unsaved-hmt

    rafaelfranca committed Sep 17, 2012
    Fix collection= on hm:t join models when unsaved
  2. Fix collection= on hm:t join models when unsaved

    ernie committed Sep 17, 2012
    If assigning to a has_many :through collection against an unsaved
    object using the collection=[<array_of_items>] syntax, the join models
    were not properly created, previously.
  3. improve AR/CHANGELOG [ci skip]

    Francesco Rodriguez
    Francesco Rodriguez committed Sep 17, 2012
  4. Merge pull request #7547 from danmcclain/pg-arrays

    rafaelfranca committed Sep 17, 2012
    Adds migration and type casting support for PostgreSQL Array datatype
Commits on Sep 16, 2012
Commits on Sep 14, 2012
  1. Moves column dump specific code to a module included in AbstractAdapter

    Dan McClain
    Dan McClain committed Aug 19, 2012
    Having column related schema dumper code in the AbstractAdapter. The
    code remains the same, but by placing it in the AbstractAdapter, we can
    then overwrite it with Adapter specific methods that will help with
    Adapter specific data types.
    The goal of moving this code here is to create a new migration key for
    PostgreSQL's array type. Since any datatype can be an array, the goal is
    to have ':array => true' as a migration option, turning the datatype
    into an array. I've implemented this in postgres_ext, the syntax is
    shown here:
    Adds array migration support
    Adds array_test.rb outlining the test cases for array data type
    Adds pg_array_parser to Gemfile for testing
    Adds pg_array_parser to postgresql_adapter (unused in this commit)
    Adds schema dump support for arrays
    Adds postgres array type casting support
    Updates changelog, adds note for inet and cidr support, which I forgot to add before
    Removing debugger, Adds pg_array_parser to JRuby platform
    Removes pg_array_parser requirement, creates ArrayParser module used by
Commits on Sep 13, 2012
  1. refactor store_accessor

    al2o3cr committed Sep 13, 2012
Commits on Sep 11, 2012
  1. Accept belongs_to assoc. keys in ActiveRecord queries

    beerlington committed Sep 11, 2012
    Allows you to specify the model association key in a belongs_to
    relationship instead of the foreign key.
    The following queries are now equivalent:
    Post.where(:author_id => Author.first)
    Post.where(:author => Author.first)
    PriceEstimate.where(:estimate_of_type => 'Treasure', :estimate_of_id => treasure)
    PriceEstimate.where(:estimate_of => treasure)
Commits on Sep 8, 2012
  1. Raise MissingAttributeError on query methods

    ernie committed Sep 6, 2012
    When calling a query method on an attribute that was not selected by
    an ActiveRecord query, an ActiveModel::MissingAttributeError is not
    raised. Instead, a nil value is returned, which will return false once
    cast to boolean.
    This is undesirable, as we should not give the impression that we know
    the attribute's boolean value when we haven't loaded the attribute's
    (possibly) non-boolean value from the database.
    This issue is present on versions going back as far as 2.3, at least.
  2. improve AR CHANGELOG [ci skip]

    Francesco Rodriguez
    Francesco Rodriguez committed Sep 8, 2012
Commits on Sep 7, 2012
  1. Remove 3.2.x entries from Active Record changelog [ci skip]

    carlosantoniodasilva committed Sep 7, 2012
    Since 810a50d, the new policy is to
    keep old changelogs in their own branches, to avoid manual syncing
    across different branches.
    Please check that commit for more reasoning about the new policy.
Commits on Sep 6, 2012
  1. ActiveRecord support to PostgreSQL 9.2 JSON type

    guedes committed Sep 5, 2012
    This implements the support to encode/decode JSON
    data to/from database and creating columns of type
    JSON using a native type [1] supported by PostgreSQL
    from version 9.2.
Commits on Sep 5, 2012