Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 17, 2012
  1. John Firebaugh

    AR::Integration must be included after AM::Conversion

    jfirebaugh authored
    Integration's definition of #to_param must override
    Conversion's. Otherwise, there is a regression from
    3.1 in the behavior of a non-persisted AR::Base instance
    which nevertheless has an id.
  2. Rafael Mendonça França

    Merge pull request #4396 from kennyj/fix_4259

    rafaelfranca authored
    Fix GH #4259. When we execute schema dumper, we must remove table_name_prefix and table_name_suffix.
Commits on Jul 13, 2012
  1. Jeremy Cole
  2. Jeremy Cole

    Only use prepared statements when bind variables are present

    jeremycole authored
    Prepared statements (prepare/execute/close) were being used unnecessarily
    when no bind variables were present, and disabling prepared statement using
    prepared_statements:false was principally broken. While bind variables were
    correctly substituted with prepared_statements:false, the prepared statement
    interface was still used, costing an extra two round trips per query.
    
    In addition to making this behavioral change, I also cleaned up the internals
    of exec_stmt and exec_without_stmt so that they behave the same (calling log
    and constructing the ActiveRecord::Result in the same way).
    
    Moving the check for binds.empty? to exec_query also will mean that several
    code paths explicitly calling exec_without_stmt could be cleaned up to once
    again call exec_query instead. I have also left the check for binds.empty? in
    exec_stmt, since it is not a private method and could be called directly with
    an empty binds array. For the sake of clarity in this patch, I have not made
    those changes.
    
    = The previous behavior =
    
    When issuing a Foo.find(1) with prepared_statements:true, the bind variable
    is present in the prepared query, and execute shows a value passed:
    
        Connect	root@localhost on rails_test
        Query	SET SQL_AUTO_IS_NULL=0
        Statistics
        Query	SHOW FULL FIELDS FROM `foos`
        Query	SHOW TABLES LIKE 'foos'
        Query	SHOW CREATE TABLE `foos`
        Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = ? LIMIT 1
        Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
        Close stmt
        Quit
    
    When issuing a Foo.find(1) with prepared_statements:false, the bind variable
    has already been removed and substituted with the value, but the prepared
    statement interface is used anyway:
    
        Connect	root@localhost on rails_test
        Query	SET SQL_AUTO_IS_NULL=0
        Statistics
        Query	SHOW FULL FIELDS FROM `foos`
        Query	SHOW TABLES LIKE 'foos'
        Query	SHOW CREATE TABLE `foos`
        Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
        Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
        Close stmt
        Quit
    
    = With this patch applied =
    
    When issuing a Foo.find(1) with prepared_statements:true, the bind variable
    is present in the prepared query, and execute shows a value passed:
    
        Connect	root@localhost on rails_test
        Query	SET SQL_AUTO_IS_NULL=0
        Statistics
        Query	SHOW FULL FIELDS FROM `foos`
        Query	SHOW TABLES LIKE 'foos'
        Query	SHOW CREATE TABLE `foos`
        Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = ? LIMIT 1
        Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
        Close stmt
        Quit
    
    When issuing a Foo.find(1) with prepared_statements:false, the bind variable
    has been removed and substituted with the value, and the query interface is
    used instead of the prepared statement interface:
    
        Connect	root@localhost on rails_test
        Query	SET SQL_AUTO_IS_NULL=0
        Statistics
        Query	SHOW FULL FIELDS FROM `foos`
        Query	SHOW TABLES LIKE 'foos'
        Query	SHOW CREATE TABLE `foos`
        Query	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
        Quit
Commits on Jul 11, 2012
  1. Robb Kidd
Commits on Jul 6, 2012
  1. Rafael Mendonça França

    Merge pull request #6985 from sidonath/disable-query-cache-for-locks

    rafaelfranca authored
    Disable query cache for lock queries
    Conflicts:
    	activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
Commits on Jul 2, 2012
  1. Francesco Rodríguez

    Backport #3329 to 3-2-stable

    frodsan authored
    Fix bug with autosave collection association on new record with a marked
    for destroy record in autosave collection.
    
    Fixes #6918.
Commits on Jun 28, 2012
  1. Rafael Mendonça França

    Merge pull request #6878 from masarakki/master

    rafaelfranca authored
    fix bug in limit of enum columns of mysql
    
    Closes #6432
  2. Carlos Antonio da Silva

    Merge pull request #6900 from cbandy/issue-6898

    carlosantoniodasilva authored
    Require URI in ConnectionSpecification
    Conflicts:
    	activerecord/lib/active_record/connection_adapters/connection_specification.rb
Commits on Jun 25, 2012
  1. Carlos Antonio da Silva

    Ensure Arel columns are typecasted properly when grouping with calcul…

    carlosantoniodasilva authored
    …ation
    
    Fix build issue with postgresql.
    
    Conflicts:
    	activerecord/lib/active_record/relation/calculations.rb
    	activerecord/test/cases/calculations_test.rb
Commits on Jun 24, 2012
  1. Rafael Mendonça França

    Merge pull request #6842 from ernie/handle-non-strings-in-grouped-cal…

    rafaelfranca authored
    …culations
    
    Stop assuming strings for grouped calculations
    Conflicts:
    	activerecord/lib/active_record/relation/calculations.rb
Commits on Jun 21, 2012
  1. Rafael Mendonça França

    Merge branch 'acapilleri-update_nested_attributes'

    rafaelfranca authored
    Closes #6675
    
    Conflicts:
    	activerecord/lib/active_record/attribute_methods/dirty.rb
Commits on Jun 19, 2012
  1. José Valim Rafael Mendonça França

    Merge pull request #6758 from caironoleto/master

    josevalim authored rafaelfranca committed
    Fixing load config in some tasks
    Conflicts:
    	activerecord/lib/active_record/railties/databases.rake
Commits on Jun 18, 2012
  1. Steve Klabnik

    Deprecating composed_of in ActiveRecord

    steveklabnik authored
    This feature adds a lot of complication to ActiveRecord for dubious
    value. Let's talk about what it does currently:
    
    class Customer < ActiveRecord::Base
      composed_of :balance, :class_name => "Money", :mapping => %w(balance
    amount)
    end
    
    Instead, you can do something like this:
    
        def balance
          @balance ||= Money.new(value, currency)
        end
    
        def balance=(balance)
          self[:value] = balance.value
          self[:currency] = balance.currency
          @balance = balance
        end
    
    Since that's fairly easy code to write, and doesn't need anything
    extra from the framework, if you use composed_of today, you'll
    have to add accessors/mutators like that.
    
    This feature will be removed in Rails 4.
Commits on Jun 14, 2012
  1. Steve Klabnik

    Deprecate update_attribute.

    steveklabnik authored
    Historically, update_attribute and update_attributes are similar, but
    with one big difference: update_attribute does not run validations.
    These two methods are really easy to confuse given their similar
    names. Therefore, update_attribute is being deprecated in favor of
    update_column, and will be removed in Rails 4.
    
    See the discussion on rails-core here:
    https://groups.google.com/d/topic/rubyonrails-core/BWPUTK7WvYA/discussion
Commits on Jun 12, 2012
  1. Aaron Patterson

    Merge branch '3-2-stable-rel' into 3-2-stable

    tenderlove authored
    * 3-2-stable-rel:
      updating changelogs
      bumping version numbers
      updating changelogs with security fixes
      updating changelogs
      Array parameters should not contain nil values.
      Additional fix for CVE-2012-2661
  2. Rafael Mendonça França

    Merge pull request #6676 from aurelian/master

    rafaelfranca authored
    Don't assign the attributes if the list is empty
Commits on Jun 11, 2012
  1. Aaron Patterson

    bumping version numbers

    tenderlove authored
  2. Ernie Miller Aaron Patterson

    Additional fix for CVE-2012-2661

    ernie authored tenderlove committed
    While the patched PredicateBuilder in 3.1.5 prevents a user
    from specifying a table name using the `table.column` format,
    it doesn't protect against the nesting of hashes changing the
    table context in the next call to build_from_hash. This fix
    covers this case as well.
  3. Toshinori Kajihara Aaron Patterson

    Fix GH #3163. Should quote database on mysql/mysql2.

    kennyj authored tenderlove committed
    Conflicts:
    
    	activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
  4. Rafael Mendonça França

    Merge pull request #6698 from yahonda/address_ora_911_master

    rafaelfranca authored
    Address ORA-00911 errors because of the heading underscore.
  5. Rafael Mendonça França

    Merge pull request #6521 from Empact/throw-result

    rafaelfranca authored
    Fix that #exists? can blow up with ThrowResult exception
    Conflicts:
    	activerecord/lib/active_record/relation/finder_methods.rb
Commits on Jun 10, 2012
  1. Thomas Steinhausen Rafael Mendonça França

    Minimal change to query generation of exists? that makes SQLServer an…

    iaddict authored rafaelfranca committed
    …d others happy that do not work without a column alias.
    
    Conflicts:
    	activerecord/lib/active_record/relation/finder_methods.rb
  2. Rafael Mendonça França

    Merge pull request #6695 from kennyj/fix_6635

    rafaelfranca authored
    Fix #6635. We should call Scoping methods, before calling Array methods.
Commits on Jun 9, 2012
  1. Tieg Zaharia
Commits on Jun 7, 2012
  1. Jon Leighton

    Revert "Perf: Don't load the association for #delete_all."

    jonleighton authored
    This reverts commit b98d1e2.
    
    Closes #6609
    
    Conflicts:
    
    	activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
Commits on Jun 4, 2012
  1. Toshinori Kajihara
Commits on Jun 1, 2012
  1. Aaron Patterson

    bumping to 3.2.5

    tenderlove authored
  2. Andrew White

    Restore behavior of Active Record 3.2.3 scopes

    pixeltrix authored
    A series of commits relating to preloading and scopes caused a regression.
    Cloning the relation calls initialize_copy which resets a number of instance
    variables to nil. Without this the scope thinks that it is already loaded
    when it is called again.
    
    Reverts the following commits:
    13f1401
    8491740
    dffbb52
    
    Fixes #6575, #6576 & #6577
Commits on May 31, 2012
  1. Aaron Patterson

    Merge branch '3-2-rel' into 3-2-stable

    tenderlove authored
    * 3-2-rel:
      bumping to 3.2.4
      adding security notifications to CHANGELOGs
      updating changelogs
      Merge pull request #6558 from parndt/fix_regression
  2. Aaron Patterson

    Merge branch '3-2-stable-sec' into 3-2-stable

    tenderlove authored
    * 3-2-stable-sec:
      Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this!
      predicate builder should not recurse for determining where columns. Thanks to Ben Murphy for reporting this
      bumping to 3.2.4.rc1
  3. Aaron Patterson

    bumping to 3.2.4

    tenderlove authored
  4. Aaron Patterson

    Merge branch '3-2-stable-sec' into 3-2-rel

    tenderlove authored
    * 3-2-stable-sec:
      Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this!
      predicate builder should not recurse for determining where columns. Thanks to Ben Murphy for reporting this
  5. Aaron Patterson

    Merge pull request #6558 from parndt/fix_regression

    tenderlove authored
    Fix regression
  6. Philip Arndt

    Revert "Removes unneeded caching from ActiveRecord::Base.relation"

    parndt authored
    This reverts commit ebfa58a.
    
    This change caused a regression in my application's tests:
    
    * Failing build http://travis-ci.org/#!/resolve/refinerycms/builds/1461242
    
    Broken tests pass after this change is reverted.
Something went wrong with that request. Please try again.