1. 31 7月, 2012 8 次提交
    • J
      Merge pull request #7197 from davidcelis/i18n_inflector · 13af5ace
      José Valim 提交于
      Make ActiveSupport::Inflector locale aware and multilingual
      13af5ace
    • R
      Merge pull request #7176 from bogdan/reverse_order · b09d6aae
      Rafael Mendonça França 提交于
      AR::Relation#order: make new order prepend old one.
      b09d6aae
    • B
      AR::Relation#order: make new order prepend old one · 92641efe
      Bogdan Gusiev 提交于
          User.order("name asc").order("created_at desc")
          # SELECT * FROM users ORDER BY created_at desc, name asc
      
      This also affects order defined in `default_scope` or any kind of associations.
      92641efe
    • D
      Make ActiveSupport::Inflector locale aware and multilingual · 7db0b073
      David Celis 提交于
      The Inflector is currently not very supportive of internationalized
      websites. If a user wants to singularize and/or pluralize words based on
      any locale other than English, they must define each case in locale
      files. Rather than create large locale files with mappings between
      singular and plural words, why not allow the Inflector to accept a
      locale?
      
      This patch makes ActiveSupport::Inflector locale aware and uses `:en`` unless
      otherwise specified. Users will still be provided a list of English (:en)
      inflections, but they may additionally define inflection rules for other
      locales. Each list is kept separately and permanently. There is no reason to
      limit users to one list of inflections:
      
          ActiveSupport::Inflector.inflections(:es) do |inflect|
            inflect.plural(/$/, 's')
            inflect.plural(/([^aeéiou])$/i, '\1es')
            inflect.plural(/([aeiou]s)$/i, '\1')
            inflect.plural(/z$/i, 'ces')
            inflect.plural(/á([sn])$/i, 'a\1es')
            inflect.plural(/é([sn])$/i, 'e\1es')
            inflect.plural(/í([sn])$/i, 'i\1es')
            inflect.plural(/ó([sn])$/i, 'o\1es')
            inflect.plural(/ú([sn])$/i, 'u\1es')
      
            inflect.singular(/s$/, '')
            inflect.singular(/es$/, '')
      
            inflect.irregular('el', 'los')
          end
      
          'ley'.pluralize(:es)   # => "leyes"
          'ley'.pluralize(:en)   # => "leys"
          'avión'.pluralize(:es) # => "aviones"
          'avión'.pluralize(:en) # => "avións"
      
      A multilingual Inflector should be of use to anybody that is tasked with
      internationalizing their Rails application.
      Signed-off-by: NDavid Celis <david@davidcelis.com>
      7db0b073
    • C
      Merge pull request #7205 from frodsan/fix_nodoc_live · 10cdeb86
      Carlos Antonio da Silva 提交于
      Fix nodoc in metal/live [ci skip]
      10cdeb86
    • F
      fix nodoc in metal/live · 829ec373
      Francesco Rodriguez 提交于
      829ec373
    • R
      Merge pull request #7203 from frodsan/typo_live · f6068f1d
      Rafael Mendonça França 提交于
      fix typo in metal/live [ci skip]
      f6068f1d
    • F
      fix typo in metal/live [ci skip] · eae19033
      Francesco Rodriguez 提交于
      eae19033
  2. 30 7月, 2012 29 次提交
  3. 29 7月, 2012 3 次提交