1. 18 8月, 2015 1 次提交
    • J
      Use == 0 instead of .zero? in #try · a94c2e1f
      Jean Boussier 提交于
      The perf gain is relatively minor but consistent:
      
      ```
      Calculating -------------------------------------
                   0.zero?   137.091k i/100ms
                   1.zero?   137.350k i/100ms
                    0 == 0   142.207k i/100ms
                    1 == 0   144.724k i/100ms
      -------------------------------------------------
                   0.zero?      8.893M (± 6.5%) i/s -     44.280M
                   1.zero?      8.751M (± 6.4%) i/s -     43.677M
                    0 == 0     10.033M (± 7.0%) i/s -     49.915M
                    1 == 0      9.814M (± 8.0%) i/s -     48.772M
      ```
      
      And try! is quite a big hotspot for us so every little gain is appreciable.
      a94c2e1f
  2. 20 5月, 2015 2 次提交
    • G
      Small stylistic tweaks for `Delegator#try` patch · 04693648
      Godfrey Chan 提交于
      * Rename `ActiveSupport::Try` => `ActiveSupport::Tryable`
      * Include the modules inline
      * `private` indentation
      04693648
    • N
      Patch `Delegator` to work with `#try` · af53280a
      Nate Smith 提交于
      `Delegator` inherits from `BasicObject`, which means that it will not
      have `Object#try` defined. It will then delegate the call to the
      underlying object, which will not (necessarily) respond to the method
      defined in the enclosing `Delegator`.
      
      This patches `Delegator` with the `#try` method to work around the
      surprising behaviour.
      
      Fixes #5790
      af53280a
  3. 03 1月, 2015 1 次提交
  4. 22 12月, 2014 1 次提交
  5. 18 12月, 2014 1 次提交
    • C
      Replace `#=>` with `# =>` [ci skip] · 23c8f691
      claudiob 提交于
      @rafaelfranca suggested in f7c7bcd9 that code examples should display
      the result after  `# =>` and not after `#=>`.
      
      This commit replaces *all* the occurrences of `#=>` in the code documentation
      (mostly added by me 😭) with the suggested `# =>`.
      23c8f691
  6. 25 10月, 2014 3 次提交
    • G
      Revert a change made to the example in 1ac4525 · cd2d3664
      Godfrey Chan 提交于
      @carlosantoniodasilva pointed out that when `@person` is nil then this would blow up when you ended up calling `#first`on `nil`.
      
      > "there’s no way to break a try chain when you enter it :D"
      
      [ci skip]
      cd2d3664
    • Z
      ea3cd405
    • E
      Improved try documentation [ci skip] · df1dda8b
      Eugene Gilburg 提交于
      - better `if` example
      - Added chaining example to the try method description
      - Documented the `respond_to?` check to the try method description
      - Clearer wording to explain that argument error is raised on argument mismatch to responding method, rather than to non-responding method (which is handled without exception by `try`)
      - `.any?` is more precise than `! .blank?`
       - Don't need to use `try` on `children` as (for regular associations) they will always be a collection or array that responds to `first`
      - Fix typos/grammar
      df1dda8b
  7. 24 10月, 2014 1 次提交
  8. 23 10月, 2014 1 次提交
  9. 30 8月, 2014 1 次提交
  10. 11 9月, 2013 1 次提交
  11. 18 8月, 2013 1 次提交
  12. 27 7月, 2013 1 次提交
  13. 29 1月, 2013 1 次提交
  14. 11 8月, 2012 1 次提交
  15. 28 7月, 2012 2 次提交
  16. 05 6月, 2012 1 次提交
  17. 20 5月, 2012 1 次提交
  18. 13 5月, 2012 2 次提交
  19. 12 5月, 2012 1 次提交
  20. 06 10月, 2011 1 次提交
  21. 22 5月, 2011 1 次提交
  22. 20 4月, 2011 1 次提交
  23. 18 4月, 2011 4 次提交
  24. 05 3月, 2011 1 次提交
  25. 04 3月, 2011 1 次提交
  26. 03 12月, 2010 1 次提交
  27. 14 11月, 2010 1 次提交
  28. 12 9月, 2010 1 次提交
  29. 21 3月, 2009 1 次提交
  30. 07 2月, 2009 1 次提交
  31. 02 2月, 2009 1 次提交
  32. 26 1月, 2009 1 次提交