Commits on Aug 3, 2012
  1. Merge pull request #7253 from acapilleri/lenght_validator_errors_options

    rafaelfranca committed Aug 3, 2012
    calculate errors_options one time in validate_each
  2. calculate errors_options one time in validate_each

    acapilleri committed Aug 3, 2012
    errors_options is calculated for every *CHECKS* but it could be
    calculated one time  because options and RESERVED_OPTIONS
    not change during this cycle
  3. Don't eager load all this

    spastorino committed Aug 3, 2012
    Some are loaded from Base which is loaded when a model inherits from it
    and some others are used in rake tasks
  4. Remove ActiveRecord::Base.to_a

    jonleighton committed Aug 3, 2012
    On reflection, it seems like a bit of a weird method to have on
    ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
  5. Allow Relation#merge to take a proc.

    jonleighton committed Aug 3, 2012
    This was requested by DHH to allow creating of one's own custom
    association macros.
    For example:
        module Commentable
          def has_many_comments(extra)
            has_many :comments, -> { where(:foo).merge(extra) }
        class Post < ActiveRecord::Base
          extend Commentable
          has_many_comments -> { where(:bar) }
  6. Merge pull request #7231 from armanddp/no_content

    rafaelfranca committed Aug 3, 2012
    Remove single character body in head(:no_content) response
Commits on Aug 2, 2012
  1. Collapsed dual checks (one for content headers and one for content) i…

    armanddp committed Aug 2, 2012
    …nto a single check.
    Rails includes a single character body to a head(:no_content) response to work around an old Safari bug where headers were ignored if no body sent.
    This patch brings the behavior slightly closer to spec if :no_content/204 is explicity requested via a head only response.
    Status comparison done on symbolic and numeric values
    Not returning any content when responding with head and limited to a status code that explicitly states no content will be returned - 100..199, 204, 205, 304.
  2. Merge pull request #7240 from steveklabnik/fix_2301

    rafaelfranca committed Aug 2, 2012
    Fix for digest authentication bug - issue #2301 in rails/rails
  3. defines a private require-hub active_support/rails

    fxn committed Aug 2, 2012
    This is a private place to put those AS features that are used
    by every component. Nowadays we cherry-pick individual files
    wherever they are used, but that it is not worth the effort
    for stuff that is going to be loaded for sure sooner or later,
    like blank?, autoload, concern, etc.
  4. Merge pull request #7129 from kennyj/fix_7079

    josevalim committed Aug 2, 2012
    Improve error handling when using partial name with hyphen. #7079
  5. Fix tests.

    rafaelfranca committed Aug 2, 2012
    Since b6ab441 the single quotes are
    being escaped in the templates.
  6. Do not consider the numeric attribute as changed if the old value is

    rafaelfranca committed Aug 2, 2012
    zero and the new value is not a string.
    Before this commit this was the behavior
    r = Review.find_by_issue(0)
    => 0
    => {}
    r.issue = 0
    => 0
    => true
    => {"issue"=>[0,0]}
    Fixes #7237
Commits on Aug 1, 2012
  1. s/scoped/scope/

    jonleighton committed Aug 1, 2012
  2. Add CollectionProxy#scope

    jonleighton committed Aug 1, 2012
    This can be used to get a Relation from an association.
    Previously we had a #scoped method, but we're deprecating that for
    AR::Base, so it doesn't make sense to have it here.
    This was requested by DHH, to facilitate code like this:
        Project.scope.order('created_at DESC').page(current_page).tagged_with(@tag).limit(5).scoping do
          @topics      = @project.topics.scope
          @todolists   = @project.todolists.scope
          @attachments = @project.attachments.scope
          @documents   = @project.documents.scope
  3. Use explicit delegations

    jonleighton committed Aug 1, 2012
    This makes it easier to see what the documentation refers to.
    It also means that we are not doing unnecessary work for delegations
    that have no args / splats / block / etc.
  4. Refactor a bit

    jonleighton committed Aug 1, 2012
    This doesn't change the exernal behavior, but it moves some code around
    to where I think it properly belongs.
  5. Add `Relation#load`

    jonleighton committed Aug 1, 2012
    This method explicitly loads the records and then returns `self`.
    Rather than deciding between "do I want an array or a relation?",
    most people are actually asking themselves "do I want to eager load
    or lazy load?" Therefore, this method provides a way to explicitly
    eager-load without having to switch from a `Relation` to an array.
        @posts = Post.where(published: true).load