Permalink
Commits on May 29, 2012
  1. @drogus

    `cat Gemfile.lock` after installing gems on travis

    It may be useful to view Gemfile.lock. If the build fails we can inspect
    it locally with exactly the same environment.
    drogus committed May 29, 2012
  2. @josevalim

    Merge pull request #6525 from freerange/minitest-passthrough-exceptions

    Exceptions like Interrupt & NoMemoryError should not be rescued in tests.
    josevalim committed May 29, 2012
  3. @floehopper
  4. @josevalim

    Merge pull request #6528 from frodsan/update_hash_syntax_gemfile_temp…

    …late
    
    update Gemfile template to 1.9 hash syntax
    josevalim committed May 29, 2012
  5. update Gemfile template to 1.9 hash syntax

    Francesco Rodriguez committed May 29, 2012
  6. @carlosantoniodasilva

    Merge pull request #6526 from appfolio/decoupling_activesupport_from_…

    …actionivew
    
    Decoupling ActiveSupport from ActionView
    carlosantoniodasilva committed May 29, 2012
  7. @amutz
  8. @carlosantoniodasilva

    Merge pull request #6527 from frodsan/add_test_to_delete_by_fixnum_or…

    …_string
    
    Add tests to delete by fixnum or string id with has many through associations
    carlosantoniodasilva committed May 29, 2012
  9. Add tests to delete by fixnum or string id with has many through asso…

    …ciations
    Francesco Rodriguez committed May 29, 2012
  10. @carlosantoniodasilva
  11. @carlosantoniodasilva
  12. @carlosantoniodasilva

    Review requires from number helper

    Some of these requires are now only necessary in
    ActiveSupport::NumberHelper. Add hash/keys require due to symbolize_keys
    usage in number helpers. Also remove some whitespaces.
    
    Closes #6414
    carlosantoniodasilva committed May 29, 2012
  13. @carlosantoniodasilva

    Yield only one argument instead of splatting.

    Add Changelog entry. Closes #4003
    carlosantoniodasilva committed May 24, 2012
  14. @chrisfinne @carlosantoniodasilva
  15. @carlosantoniodasilva

    Merge pull request #6511 from frodsan/add_fixnum_string_support_for_d…

    …elete
    
    Add support for CollectionAssociation#delete by Fixnum or String
    carlosantoniodasilva committed May 29, 2012
  16. @carlosantoniodasilva

    Parse float value only once in number helpers

    Refactor number helpers output with safety handling to call float
    parsing only once. Also remove 'erb' require.
    carlosantoniodasilva committed May 29, 2012
  17. Add support for CollectionAssociation#delete by Fixnum or String

    I found the next issue between CollectionAssociation `delete`
    and `destroy`.
    
        class Person < ActiveRecord::Base
          has_many :pets
        end
    
        person.pets.destroy(1)
        # => OK, returns the destroyed object
    
        person.pets.destroy("2")
        # => OK, returns the destroyed object
    
        person.pets.delete(1)
        # => ActiveRecord::AssociationTypeMismatch
    
        person.pets.delete("2")
        # => ActiveRecord::AssociationTypeMismatch
    
    Adding support for deleting with a fixnum or string like
    `destroy` method.
    Francesco Rodriguez committed May 29, 2012
Commits on May 28, 2012
  1. @floehopper

    Exceptions like Interrupt should not be rescued.

    Neither Test::Unit nor MiniTest rescue exceptions like Interrupt or
    NoMemoryError, but ActiveSupport::Testing::SetupAndTeardown#run which
    overrides MiniTest::Unit::TestCase#run rescues them.
    
    Rescuing an Interrupt exception is annoying, because it means when you
    are running a lot of tests e.g. when running one of the rake test tasks,
    you cannot break out using ctrl-C.
    
    Rescuing exceptions like NoMemoryError is foolish, because the most
    sensible thing to happen is for the process to terminate as soon as
    possible.
    
    This solution probably needs some finessing e.g. I'm not clear whether
    the assumption is that only MiniTest is supported. Also early versions
    of MiniTest did not have this behaviour. However, hopefully it's a
    start.
    
    Integrating with Test::Unit & MiniTest has always been a pain. It would
    be great if both of them provided sensible extension points for the kind
    of things that both Rails and Mocha want to do.
    floehopper committed May 28, 2012
  2. @josevalim

    Merge pull request #6522 from lest/patch-1

    ActiveSupport require and dependencies
    josevalim committed May 28, 2012
  3. @lest

    make AS::Multibyte::Chars work w/o multibyte core ext

    Use ActiveSupport::Multibyte::Chars.new instead of String#mb_chars.
    It allows to use ActiveSupport::Multibyte::Chars without requiring
    String multibyte core extension.
    lest committed May 28, 2012
  4. @lest

    remove unnecessary require

    AS::Multibyte are no longer required by access and filters string
    core extensions.
    lest committed May 28, 2012
  5. @josevalim

    Merge pull request #6517 from purcell/validates-false-value

    Don't enable validations when passing false hash values to ActiveModel.validates
    josevalim committed May 28, 2012
  6. @purcell

    Don't enable validations when passing false hash values to ActiveMode…

    …l.validates
    
    Passing a falsey option value for a validator currently causes that validator to
    be enabled, just like "true":
    
        ActiveModel.validates :foo, :presence => false
    
    This is rather counterintuitive, and makes it inconvenient to wrap `validates` in
    methods which may conditionally enable different validators.
    
    As an example, one is currently forced to write:
    
          def has_slug(source_field, options={:unique => true})
            slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? }
            before_validation slugger
            validations = { :presence => true, :slug => true }
            if options[:unique]
              validations[:uniqueness] = true
            end
            validates :slug, validations
          end
    
    because the following reasonable-looking alternative fails to work as expected:
    
          def has_slug(source_field, options={:unique => true})
            slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? }
            before_validation slugger
            validates :slug, :presence => true, :slug => true, :uniqueness => options[:unique]
          end
    
    (This commit includes a test, and all activemodel and activerecord tests pass as before.)
    purcell committed May 28, 2012
  7. @josevalim

    Merge pull request #6512 from jaredbeck/fix_number_to_currency_neg_fo…

    …rmat
    
    Fix handling of negative zero in number_to_currency
    josevalim committed May 28, 2012
  8. @jaredbeck
  9. @josevalim

    Merge pull request #6315 from appfolio/moving_number_helper_methods_t…

    …o_active_support
    
    Moving number helper from ActionView to Active Support
    josevalim committed May 28, 2012
  10. @drogus

    Fix sorting of helpers from different paths

    When more than one directory for helpers is provided to a controller, it
    should preserver the order of directories. Given 2 paths:
    
        MyController.helpers_paths = ["dir1/helpers", "dir2/helpers"]
    
    helpers from dir1 should be loaded first. Before this commit, all
    helpers were mixed and then sorted alphabetically, which essentially
    would require to rename helpers to get desired order.
    
    This is a problem especially for engines, where you would like to be
    able to predict accurately which engine helpers will load first.
    
    (closes #6496)
    drogus committed May 27, 2012
  11. @amutz
Commits on May 27, 2012
  1. @vijaydev
  2. @vijaydev

    copy edits [ci skip]

    vijaydev committed May 27, 2012
  3. @drogus

    Fix railties_order when application object is passed

    railites_order method, introduced in 40b19e0, had a bug that was causing
    loading application instance twice in initializers if railties_order
    already included application instance. So for example
    
        railties_order = [Foo::Engine, :main_app, Bar::Engine]
    
    would result in such railties array:
    
        [MyApp::Application, Foo::Engine, MyAppApplication, Bar::Engine]
    
    In order to fix it, we need to check for existence of application in
    both railties_order and railties arrays.
    drogus committed May 27, 2012
  4. update Module#mattr_accessor documentation [ci skip]

    Francesco Rodriguez committed May 27, 2012
  5. add CollectionProxy#uniq documentation

    Francesco Rodriguez committed May 27, 2012
  6. update Hash documentation with 1.9 syntax [ci skip]

    Francesco Rodriguez committed May 27, 2012