1. 07 2月, 2015 21 次提交
    • S
      254693a3
    • S
      009e3d0b
    • S
      Grammar and RDoc formatting · d2db3213
      Sean Griffin 提交于
      d2db3213
    • X
      Remove reference to the now done documentation.rake · bde5f345
      Xavier Noria 提交于
      bde5f345
    • X
      README.rdoc -> README.md for newly generated applications · 89a12c93
      Xavier Noria 提交于
      README.rdoc was generated to support the doc:app task. Now that
      this task is gone we can switch to Markdown, which is nowadays
      a better default.
      89a12c93
    • X
      Remove documentation tasks · cd7cc525
      Xavier Noria 提交于
      This patch removes the tasks doc:app, doc:rails, and doc:guides.
      
      In our experience applications do not generate APIs using doc:app.
      Methods may be certainly documented for maintainers, annotated
      with YARD tags, etc. but that is intended to be read with the
      source code, not in a separate website. Then, teams also have
      typically selected topics written down in Markdown files, or in
      a GitHub wiki... that kind of thing.
      
      If a team absolutely needs to generate application documentation
      for internal purposes, they can still easily write their own task.
      
      Regarding doc:rails and doc:guides, we live in 2015. We are used
      to go to online docs all the time. If you really want access to the
      API offline RubyGems generates it for every Rails component unless
      you tell it not to, and you can checkout the Rails source code to
      read the guides as Markdown, or download them for a Kindle reader.
      
      All in all, maintaining this code does not seem to be worthwhile
      anymore.
      
      As a consequence of this, guides (+3 MB uncompressed) won't be
      distributed with the rails gem anymore. Of course, guides and API
      are going to be still part of releases, since documentation is
      maintained alongside code and tests.
      
      Also, time permitting, this will allow us to experiment with novel
      ways to generate documentation in the Rails docs server, since
      right now we were constrained by being able to generate them in
      the user's environment.
      cd7cc525
    • S
      Docs pass for the attributes API · 8c752c7a
      Sean Griffin 提交于
      8c752c7a
    • R
      Raise ArgumentError when passing nil to Relation#merge · b71e08f8
      Rafael Mendonça França 提交于
      nil or false should not be valid argument to the merge method.
      
      Closes #12264
      b71e08f8
    • R
      Stoping using Relation#merge in default_scoped · e26fa7b9
      Rafael Mendonça França 提交于
      Relation#merge checks if the argument is an array and the only possible
      returns of build_default_scope is nil or a Relation.
      
      Doing this we can raise an ArgumentError when Relation#merge receive a
      nil value.
      e26fa7b9
    • R
      Merge pull request #18833 from perceptec/add_only_performed_option · decb7b66
      Rafael Mendonça França 提交于
      Add an `:only` option to `perform_enqueued_jobs` to filter jobs based on type.
      decb7b66
    • M
      Add an `:only` option to `perform_enqueued_jobs` to filter jobs based on · e818f657
      Michael Ryan 提交于
      type.
      
      This allows specific jobs to be tested, while preventing others from
      being performed unnecessarily.
      
      Example:
      
          def test_hello_job
            assert_performed_jobs 1, only: HelloJob do
              HelloJob.perform_later('jeremy')
              LoggingJob.perform_later
            end
          end
      
      An array may also be specified, to support testing multiple jobs.
      
      Example:
      
          def test_hello_and_logging_jobs
            assert_nothing_raised do
              assert_performed_jobs 2, only: [HelloJob, LoggingJob] do
                HelloJob.perform_later('jeremy')
                LoggingJob.perform_later('stewie')
                RescueJob.perform_later('david')
              end
            end
          end
      
      Fixes #18802.
      
      Trim space and document :only option.
      e818f657
    • S
      Significantly improve the performance of `_read_attribute` on JRuby · ec6c98f7
      Sean Griffin 提交于
      The `&block` form is more than twice as fast as the manual form of
      delegation (and is the code I'd rather write anyway). Unfortunately,
      it's still twice as slow on MRI. However, this is enough of a hotspot to
      justify giving JRuby special treatment.
      
      I can't currently provide benchmarks in the context of Active Record,
      since the JDBC adapters still aren't updated for 4.2, but the actual
      work performed (assuming it's been read at least once already) will have
      nearly the same performance characteristics as
      https://gist.github.com/sgrif/b86832786551aaee74de.
      ec6c98f7
    • R
      Use keyword argument in the find_in_batches API · f4e8d673
      Rafael Mendonça França 提交于
      We already validate the keys, so it is better to use the built-in
      feature to do this
      f4e8d673
    • S
      Allow a symbol to be passed to `attribute`, in place of a type object · 101c19f5
      Sean Griffin 提交于
      The same is not true of `define_attribute`, which is meant to be the low
      level no-magic API that sits underneath. The differences between the two
      APIs are:
      
      - `attribute`
        - Lazy (the attribute will be defined after the schema has loaded)
        - Allows either a type object or a symbol
      - `define_attribute`
        - Runs immediately (might get trampled by schema loading)
        - Requires a type object
      
      This was the last blocker in terms of public interface requirements
      originally discussed for this feature back in May. All the
      implementation blockers have been cleared, so this feature is probably
      ready for release (pending one more look-over by me).
      101c19f5
    • R
      Merge branch 'rm-ntp' · d7318599
      Rafael Mendonça França 提交于
      Merge #12067 rebasing and improving the code.
      d7318599
    • R
      Merge pull request #12067 from jackxxu/keep_precision · 2d2bcde3
      Rafael Mendonça França 提交于
      Enable number_to_percentage to keep the number's precision by allowing :precision option value to be nil
      
      Conflicts:
      	activesupport/CHANGELOG.md
      	activesupport/lib/active_support/number_helper.rb
      	activesupport/test/number_helper_test.rb
      2d2bcde3
    • R
      Merge pull request #18831 from colinrymer/patch-1 · 01c86fbf
      Rafael Mendonça França 提交于
      Indicate link_to creates an anchor element
      01c86fbf
    • C
      Indicate link_to creates an anchor element · 7fb6759a
      Colin Rymer 提交于
      The `link_to` helper generates an HTML anchor element (consisting of opening and closing anchor tags and an element body). The docs currently state the a link tag is generated (which would indicate a tag like `<link>`, which is another valid HTML tag), so this change clarifies that an anchor element is actually generated.
      
      [ci skip]
      7fb6759a
    • S
      Revert "Improve the performance of HWIDA `select` and `reject`" · 8f6cfd9e
      Sean Griffin 提交于
      This reverts commit 9c47b874.
      8f6cfd9e
    • S
      Improve the performance of HWIDA `select` and `reject` · 9c47b874
      Sean Griffin 提交于
      These are (potentially, depending on input) called in several places in
      both the router, and Active Record. The code also becomes much cleaner.
      This results in ~33% performance gain in both methods.
      
          Calculating -------------------------------------
                        before    15.696k i/100ms
                        after     19.865k i/100ms
          -------------------------------------------------
                        before    303.064k (± 2.6%) i/s -      1.523M
                        after     446.734k (± 2.4%) i/s -      2.245M
      
      On Ruby 2.2, a warning will be emitted about states not being copied,
      because we're calling `super` from a subclass. We can safely ignore it,
      however, since we're converting the result back into a HWIDA
      9c47b874
    • R
      Merge pull request #14028 from uberllama/json_escape_comments · de9313ce
      Rafael Mendonça França 提交于
      Amended json_escape comments
      de9313ce
  2. 06 2月, 2015 19 次提交