Skip to content
This repository

Feb 25, 2013

  1. Yves Senn

    Expand order(:symbol) to "table".symbol to prevent broken queries on PG.

    Fixes #9275.
    
    When `#order` is called with a Symbol this patch will prepend the quoted_table_name.
    Before the postgresql adapter failed to build queries containg a join and an order
    with a symbol.
    
    This expansion happens for all adapters.
    authored February 25, 2013

Feb 24, 2013

  1. Rafael Mendonça França

    Make explicit the method will raise an exception

    Taking the wise advice of @carlosantoniodasilva
    authored February 24, 2013

Feb 20, 2013

  1. Rafael Mendonça França

    Merge pull request #9345 from wangjohn/change_name_of_query_method_ar…

    …gument_checker_for_clarity
    
    Renaming the check_empty_arguments method to something more descriptive.
    authored February 20, 2013
  2. Xavier Noria

    removes some remaining relation bang methods documentation [ci skip]

    authored February 20, 2013
  3. Xavier Noria

    adds an example in the docs of #not with multiple conditions [ci skip]

    authored February 20, 2013
  4. John J. Wang

    Renaming the check_empty_arguments method to something more descriptive.

    The function is now called has_arguments? so that it's easier to tell
    that it's just checking to see if the args are blank or not.
    authored February 20, 2013
  5. John J. Wang

    Added comments about the check_empty_arguments method which is called

    for query methods in a where_clause. Also, modified the CHANGELOG entry
    because it had false information and added tests.
    authored February 19, 2013

Feb 19, 2013

  1. Raise an error when query methods have blank arguments, and when blan…

    …k arguments are meaningless.
    authored February 11, 2013 John J Wang committed February 19, 2013

Feb 07, 2013

  1. Maurizio De Santis

    Add example for ActiveRecord::Base.joins using a string as argument

    authored February 07, 2013
  2. Maurizio De Santis

    Add example for ActiveRecord::Base.group using a string as argument

    authored February 07, 2013
  3. Maurizio De Santis

    Add documentation for ActiveRecord.select when use strings as arguments

    authored February 07, 2013

Jan 24, 2013

  1. Aaron Patterson

    reduce the number of queries on IN clauses, fix relation queries in `…

    …where`
    authored January 24, 2013

Dec 08, 2012

  1. Carlos Antonio da Silva

    Improve where.not docs [ci skip]

    * Fix example queries
    * Remove doc entries of where.like/not_like.
    * Remove :chain from where.not related docs. To me that's an implementation
      detail and we don't expect people to use where(:chain).not.

Dec 07, 2012

  1. Carlos Antonio da Silva

    Rollback where.like and where.not_like

    The real win with these chain methods is where.not, that takes care of
    different scenarios in a graceful way, for instance when the given value
    is nil.
    
        where("author.id != ?", author_to_ignore.id)
        where.not("author.id", author_to_ignore.id)
    
    Both where.like and where.not_like compared to the SQL versions doesn't
    seem to give us that much:
    
        Post.where("title LIKE 'ruby on%'")
        Post.where.like(title: 'ruby on%'")
        Post.where("title NOT LIKE 'ruby on%'")
        Post.where.not_like(title: 'ruby on%'")
    
    Thus Rails is adding where.not, but not where.like/not_like and others.
  2. Claudio B.

    Document the types of arguments accepted by AR#not

    This commit stems from #8332 (comment)
    
    Since the formats in which conditions can be passed to `not` differ
    from the formats in which conditions can be passed to `like` and `not_like`,
    then I think it's worth adding rdoc and tests to show this behavior
    authored December 07, 2012
  3. Carlos Antonio da Silva

    Fix where.not with in clause

    Arel::Nodes::In inherits from Arel::Nodes::Equality, so the case
    statement was always using the Equality operator for both scenarios,
    resulting in a not equal query instead.
  4. Claudio B.

    Update #where rdoc to match 6ba0f97 [ci skip]

    This commit updates the rdoc of AR#where to match the changes applied
    in 6ba0f97 that is:
    
    * `where(nil)` has the same effect of `where('')`: a no op
    * `where` (no args) has the same effect of `where(:chain)`: to create a WhereChain
    authored December 07, 2012
  5. Carlos Antonio da Silva

    Ensure there won't be any regression with where(nil) calls

    Consider this scenario:
    
        if params[:foo]
          conditions = { foo: true }
        end
    
        foos = Foo.where(conditions).order(:id)
    
    When params[:foo] is nil, this would call:
    
        foos = Foo.where(nil).order(:id)
    
    In this scenario, we want Foo.where(conditions) to be the same as calling
    Foo.all, otherwise we'd get a "NoMethodError order for WhereChain".
    
    Related to #8332.
  6. Carlos Antonio da Silva

    Merge pull request #8332 from amatsuda/ar_where_chain

    Relation.where with no args can be chained with not, like, and not_like
    
    Conflicts:
    	activerecord/CHANGELOG.md
    	activerecord/lib/active_record/relation/query_methods.rb

Nov 30, 2012

  1. Jon Leighton

    Mark Relation mutators as :nodoc:

    These are for internal use only and cannot be relied on as part of the
    public API. See discussion on 8c2c605.
    authored November 30, 2012

Nov 29, 2012

  1. Akira Matsuda

    Relation.where with no args can be chained with not, like, and not_like

    examples:
    
      Model.where.not field: nil
      #=> "SELECT * FROM models WHERE field IS NOT NULL
    
      Model.where.like name: 'Jeremy%'
      #=> "SELECT * FROM models WHERE name LIKE 'Jeremy%'
    
    this feature was originally suggested by Jeremy Kemper #5950 (comment)
    
    Closes #5950
    authored November 05, 2012

Nov 16, 2012

  1. Vijay Dev

    Merge branch 'master' of github.com:lifo/docrails

    Conflicts:
    	actionpack/lib/action_dispatch/routing/redirection.rb
    authored November 17, 2012

Nov 10, 2012

  1. Avner Cohen

    1.9 Syntax related changes

    authored November 10, 2012

Nov 04, 2012

  1. Carlos Antonio da Silva

    Use flat_map when building AR order

Oct 28, 2012

  1. Juanjo Bazán

    ActiveRecord::Relation#none! method.

    authored September 25, 2012

Oct 15, 2012

  1. Aaron Patterson

    buckets hash isn't public, so use symbol keys to avoid string

    allocations
    authored October 15, 2012

Oct 12, 2012

  1. Aaron Patterson

    performance improvements to joins!

    Before:
    
    Calculating -------------------------------------
                      ar        87 i/100ms
    -------------------------------------------------
                      ar      823.4 (±11.8%) i/s -       4089 in   5.070234s
    
    After:
    
    Calculating -------------------------------------
                      ar        88 i/100ms
    -------------------------------------------------
                      ar      894.1 (±3.9%) i/s -       4488 in   5.028161s
    
    Same test as 3a6dfca
    authored October 12, 2012
  2. Yves Senn

    trailling whitespace cleanup in query_methods.rb

    authored October 12, 2012
  3. Tima Maslyuchenko

    learn ActiveRecord::QueryMethods#order work with hash arguments

    authored September 26, 2012

Oct 05, 2012

  1. Santiago Pastorino

    Revert "Use flat_map { } instead of map {}.flatten"

    This reverts commit abf8de8.
    We should take a deeper look to those cases flat_map doesn't do deep
    flattening.
    
    irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten
    => [1, 3, 1, 2]
    irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i}
    => [[1, 3], [1, 2]]
    authored October 05, 2012
  2. Santiago Pastorino

    Use flat_map { } instead of map {}.flatten

    authored October 05, 2012

Sep 12, 2012

  1. Jon Leighton

    Pass in the model class rather than engine

    In some circumstances engine was Arel::Table.engine which for separate
    reasons was an ActiveRecord::Model::DeprecationProxy, which caused a
    deprecation warning.
    
    In any case, we want the actual model class here, since we want to use
    it to infer information about associations.
    authored September 13, 2012

Sep 11, 2012

  1. Peter Brown

    Accept belongs_to assoc. keys in ActiveRecord queries

    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)
    authored September 11, 2012

Aug 23, 2012

  1. Isaac Sanders

    Model.select takes a variable list of arguments.

    This is a cleaner version of #6916.
    
    Closes #3165.
    authored August 23, 2012 frodsan committed August 23, 2012

Aug 02, 2012

  1. Xavier Noria

    load active_support/core_ext/object/blank in active_support/rails

    authored August 02, 2012
Something went wrong with that request. Please try again.