Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jun 23, 2012
  1. @tenderlove
Commits on Jun 22, 2012
  1. @tenderlove

    fix some accidental nils

    tenderlove authored
  2. @rafaelfranca

    Merge pull request #6832 from frodsan/nodoc_patch1

    rafaelfranca authored
    add :nodoc: to internal implementations [ci skip]
  3. @frodsan
  4. @rafaelfranca

    Merge pull request #6821 from tonywok/pg_datetime_precision

    rafaelfranca authored
    Allow precision option for postgresql datetimes
  5. @tonywok

    Allow precision option for postgresql datetimes

    tonywok authored
    This patch addresses the difficulty of retrieving datetime fields. By default, the database holds a higher precision than the time as a String.
    
    This issue is discussed at length at the following links:
    - [#3519](rails#3519)
    - [#3520](rails#3520)
    
    Also, kudos to @mattscilipoti
  6. @rafaelfranca

    Merge pull request #6829 from frodsan/misunderstood_param

    rafaelfranca authored
    change param name to improve documentation
  7. @frodsan

    change param name to improve documentation

    frodsan authored
    The keys of the error messages are actually attribute names. It makes
    the documentation easier to understand:
    
        # Returns +true+ if the error messages include an error for the given
        # +attribute+, +false+ otherwise.
        #
        #   person.errors.messages # => { :name => ["can not be nil"] }
        #   person.errors.include?(:name) # => true
        #   person.errors.include?(:age)  # => false
        def include?(attribute)
          (v = messages[attribute]) && v.any?
        end
  8. @vijaydev
  9. @vijaydev
  10. @vijaydev
  11. @rafaelfranca

    Merge pull request #6800 from mschneider/dynamic_finders_for_aliased_…

    rafaelfranca authored
    …attributes
    
    Dynamic finders for aliased attributes
  12. @mschneider

    made dynamic finders alias_attribute aware

    mschneider authored
    previously dynamic finders only worked in combination with the actual
    column name and not its alias defined with #alias_attribute
  13. @carlosantoniodasilva
  14. @carlosantoniodasilva

    Merge branch 'pluck-multiple-columns'

    carlosantoniodasilva authored
    Allow ActiveRecord::Relation#pluck to accept multiple columns. Returns an
    array of arrays containing the type casted values:
    
        Person.pluck(:id, :name)
        # SELECT people.id, people.name FROM people
        # [[1, 'David'], [2, 'Jeremy'], [3, 'Jose']]
    
    Closes #6500
  15. @carlosantoniodasilva
  16. @carlosantoniodasilva

    Refactor pluck with multiple columns

    carlosantoniodasilva authored
    Ensure it works with mix of symbols and strings, and with a select
    clause possibly containing more than one column.
    
    Also remove support for pluck with an array of columns, in favor of
    passing the list of attributes:
    
        Model.pluck(:a, :b)
    
    See comments: rails#6500 (comment)
  17. @carlosantoniodasilva

    ActiveRecord#pluck now accepts multiple columns

    jeroeningen authored carlosantoniodasilva committed
  18. @carlosantoniodasilva

    Fix serializable_hash with xml generation and default :except option

    carlosantoniodasilva authored
    When generating xml with a custom implementation of serializable_hash,
    if using the :except option, it was being overriden by the default AR
    implementation that attempts to ignore the inheritance column from STI
    automatically. So, if you have an implementation like this:
    
        def serializable_hash(options={})
          super({ except: %w(some_attr) }.merge!(options))
        end
    
    The :except option was correctly being used for :json generation, but
    not for :xml, because the options hash already contained the :except
    key with the inheritance column, thus overriding the customization.
    
    This commit fixes this problem by removing the :except logic from the
    xml serializer, that happened before calling serializable_hash. Since
    serializable_hash also does the same check for inheritance column, this
    logic was duplicated in both places, thus it's safe to remove it from
    xml serializer (see ActiveRecord::Serialization#serializable_hash).
    
    This is an attempt to solve issue #2498, that claims for a
    "Single transformation API for both xml and json representations".
  19. @carlosantoniodasilva

    Add some coverage for AR serialization with serializable_hash

    carlosantoniodasilva authored
    ActiveRecord json/xml serialization should use as base
    serializable_hash, provided by ActiveModel. Add some more coverage
    around options :only and :except for both json and xml serialization.
  20. @jonleighton
  21. @pixeltrix
  22. @frodsan
  23. @pixeltrix

    Improve the derivation of HABTM assocation join table names

    pixeltrix authored
    Improve the derivation of HABTM join table name to take account of nesting.
    It now takes the table names of the two models, sorts them lexically and
    then joins them, stripping any common prefix from the second table name.
    
    Some examples:
    
      Top level models
      (Category <=> Product)
      Old: categories_products
      New: categories_products
    
      Top level models with a global table_name_prefix
      (Category <=> Product)
      Old: site_categories_products
      New: site_categories_products
    
      Nested models in a module without a table_name_prefix method
      (Admin::Category <=> Admin::Product)
      Old: categories_products
      New: categories_products
    
      Nested models in a module with a table_name_prefix method
      (Admin::Category <=> Admin::Product)
      Old: categories_products
      New: admin_categories_products
    
      Nested models in a parent model
      (Catalog::Category <=> Catalog::Product)
      Old: categories_products
      New: catalog_categories_products
    
      Nested models in different parent models
      (Catalog::Category <=> Content::Page)
      Old: categories_pages
      New: catalog_categories_content_pages
    
    Also as part of this commit the validity checks for HABTM assocations have
    been moved to ActiveRecord::Reflection One side effect of this is to move when
    the exceptions are raised from the point of declaration to when the association
    is built. This is consistant with other association validity checks.
  24. @carlosantoniodasilva
Commits on Jun 21, 2012
  1. @frodsan
  2. @rafaelfranca

    Merge pull request #6818 from frodsan/add_nodoc_instancemethod

    rafaelfranca authored
    add :nodoc: to AM::AttributeMethods#instance_method_already_implemented?...
  3. @frodsan
  4. @frodsan
  5. @tenderlove
  6. @frodsan
  7. @wycats

    Merge pull request #6428 from pinetops/resolver_concurrency_fix

    wycats authored
    Make the Resolver template cache threadsafe
  8. @rafaelfranca

    Merge pull request #6815 from frodsan/add_nodoc_attrmethodmatcher

    rafaelfranca authored
    add :nodoc: to AM::AttributeMethods::AttributeMethodMatcher
  9. @frodsan
  10. @tenderlove

    stop subclassing string

    tenderlove authored
Something went wrong with that request. Please try again.