Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Small stylistic tweaks for `Delegator#try` patch | Godfrey Chan | 2015-05-19 | 1 | -5/+5 | |
| | | | | | | * Rename `ActiveSupport::Try` => `ActiveSupport::Tryable` * Include the modules inline * `private` indentation | |||||
* | Patch `Delegator` to work with `#try` | Nate Smith | 2015-05-19 | 1 | -17/+57 | |
| | | | | | | | | | | | | `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 | |||||
* | deep_dup method, remove old key from duplicated hash to avoid unnecessary pairs | Mehmet Emin İNAÇ | 2015-05-04 | 1 | -0/+1 | |
| | ||||||
* | [ci skip] Remove unnecessary `>` | yui-knk | 2015-03-31 | 1 | -1/+1 | |
| | ||||||
* | Mark some constants as nodoc and remove unneeded namespace | Rafael Mendonça França | 2015-03-20 | 1 | -11/+9 | |
| | ||||||
* | Use Module#prepend instead of alias_method_chain | Kir Shatrov | 2015-03-20 | 1 | -12/+16 | |
| | | | | | | | Thanks @fbernier for suggestion! <3 At this moment we can use Module#prepend in all all cases except of Range because of the bug [1] in MRI 2.2 [1] https://bugs.ruby-lang.org/issues/10847 | |||||
* | Remove some comments about Ruby 1.9 behaviors | Rafael Mendonça França | 2015-01-04 | 1 | -1/+1 | |
| | ||||||
* | Remove hack to support BigDecimal in Ruby 1.9 | claudiob | 2015-01-04 | 1 | -11/+2 | |
| | | | | | Now that Rails requires Ruby >= 2.0, there is no need to check whether `BigDecimal` exists or not. | |||||
* | Fix a few typos [ci skip] | Robin Dupret | 2015-01-03 | 1 | -1/+1 | |
| | ||||||
* | Merge branch 'master' of github.com:rails/docrails | Vijay Dev | 2015-01-03 | 1 | -3/+9 | |
|\ | ||||||
| * | Add docs for `Object.nil!` | claudiob | 2014-12-22 | 1 | -3/+9 | |
| | | | | | | | | | | | | Also add doc examples for `Object.nil`. [ci skip] | |||||
* | | Removed Object#itself as it's implemented in ruby 2.2 | Cristian Bica | 2014-12-29 | 1 | -15/+0 | |
|/ | ||||||
* | Replace `#=>` with `# =>` [ci skip] | claudiob | 2014-12-17 | 1 | -2/+2 | |
| | | | | | | | | @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 :sob:) with the suggested `# =>`. | |||||
* | Pass symbol as an argument instead of a block | Erik Michaels-Ober | 2014-11-29 | 3 | -3/+3 | |
| | ||||||
* | Revert a change made to the example in 1ac4525 | Godfrey Chan | 2014-10-24 | 1 | -1/+1 | |
| | | | | | | | @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] | |||||
* | Include return value in examples added in #17378 [ci skip] | Zachary Scott | 2014-10-24 | 1 | -2/+2 | |
| | ||||||
* | Improved try documentation [ci skip] | Eugene Gilburg | 2014-10-24 | 1 | -8/+25 | |
| | | | | | | | | | | - 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 | |||||
* | DRY up try/try! | Ari Pollak | 2014-10-23 | 1 | -10/+6 | |
| | ||||||
* | Bring try! into parity with try. | Ari Pollak | 2014-10-22 | 1 | -1/+1 | |
| | | | | Based on commit 5e51bdda. | |||||
* | [ci skip] Add Doc of with_options for the case when inherited default ↵ | Pramod Sharma | 2014-10-18 | 1 | -1/+15 | |
| | | | | options and original options have same keys | |||||
* | Methods are not duplicable. | Peter Jaros | 2014-09-03 | 1 | -0/+10 | |
| | ||||||
* | We tenderized the wrong method! Object#try already had the yield option, ↵ | David Heinemeier Hansson | 2014-08-29 | 2 | -15/+12 | |
| | | | | just needed some tenderloving instance_eval to fit the bill | |||||
* | Use instance_eval on @tenderlove's suggestion :trollface: | David Heinemeier Hansson | 2014-08-29 | 1 | -4/+5 | |
| | ||||||
* | Update examples to show real worth | David Heinemeier Hansson | 2014-08-29 | 1 | -1/+1 | |
| | ||||||
* | Added yield to Object#presence | David Heinemeier Hansson | 2014-08-29 | 1 | -1/+12 | |
| | ||||||
* | Add documentation intro to example for `Object#itself`. | Zachary Scott | 2014-08-19 | 1 | -2/+5 | |
| | | | | | Also moved comment for removal above `unless()` to not confuse RDoc with the documentation for this method. | |||||
* | Fix AS docs / changelog with wrong method [ci skip] | Carlos Antonio da Silva | 2014-08-05 | 1 | -1/+1 | |
| | ||||||
* | Update itself.rb [ci skip] | Jon Atack | 2014-08-05 | 1 | -1/+1 | |
| | ||||||
* | Only define Objetc#itself when it is not defined | Rafael Mendonça França | 2014-08-04 | 1 | -8/+10 | |
| | | | | | | | Ruby 2.2 will include Kernel#itself so we don't need to define again. See https://github.com/ruby/ruby/commit/0a0160d6b659f6131a525fe1579e7c463d4c197e | |||||
* | Rename Object#self to Object#itself to have parity with matz sanctioned ↵ | David Heinemeier Hansson | 2014-08-01 | 1 | -2/+2 | |
| | | | | method name for Ruby 2.2 | |||||
* | Added Object#self which returns the object itself | David Heinemeier Hansson | 2014-08-01 | 1 | -0/+10 | |
| | ||||||
* | Add implicit receiver support to `Object#with_options` | Pavel Pravosud | 2014-07-29 | 1 | -2/+15 | |
| | ||||||
* | Fixed a compatibility issue with the `Oj` gem | Godfrey Chan | 2014-07-29 | 1 | -3/+3 | |
| | | | | | | | | | | | | | `Time#as_json`, `Date#as_json` and `DateTime#as_json` incorrectly depends on a delegation that is set up in `active_support/json/encoding`. We cannot simply require that file in `core_ext/object/json` because it would cause a circular dependency problem (see #12203 for background). We should instead rely on AS's autoload to load that file for us on-demand. To trigger autoload correctly, we need to reference the `AS::JSON::Encoding` constant instead of using the delegated version. Fixes #16131. | |||||
* | Merge pull request #15629 from akshay-vishnoi/test-to_param | Rafael Mendonça França | 2014-07-28 | 2 | -66/+59 | |
|\ | | | | | Define Hash#to_query and set Hash#to_param as alias to it; with test cases | |||||
| * | Move to_param to to_query, also Improve tests | Akshay Vishnoi | 2014-06-20 | 2 | -66/+59 | |
| | | ||||||
* | | [ci skip] BigDecimal#duplicable? returns false in 1.9.x | Akshay Vishnoi | 2014-06-13 | 1 | -1/+1 | |
| | | ||||||
* | | Revert "remove unnecssary require of `to_param`, as `to_query` is already ↵ | Rafael Mendonça França | 2014-06-11 | 1 | -0/+1 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | require `to_param`" Revert "No need to require to_param, it is already required in to_query.rb" This reverts commits ccdd97662e1fb00c23c90d59f65c091904959561 and d697ee14264a90a39cdbe87857656d8b314ac9b7. Reason by @jeremy: These requires are not for implementation dependency. They ensure that requiring array conversions provides to_query, to_param, and other array conversion behaviors. The fact that to_query is implemented in terms of to_param is just a coincidence. If to_query removed its to_param require, then someone requiring array conversions would no longer have to_param available. This change removes these intentional dependencies on to_param in favor of implementation side effects—an undesirable move that's susceptible to regression. | |||||
* | | No need to require to_param, it is already required in to_query.rb | Akshay Vishnoi | 2014-06-11 | 1 | -1/+0 | |
|/ | ||||||
* | Do not check defined?(CGI) on every call #to_query | printercu | 2014-05-13 | 1 | -1/+1 | |
| | ||||||
* | No need the else clause | Rafael Mendonça França | 2014-05-04 | 1 | -2/+0 | |
| | ||||||
* | Merge pull request #14949 from bogdan/empty-hash-array-parameterization | Rafael Mendonça França | 2014-05-04 | 1 | -6/+6 | |
|\ | | | | | [Fixes #14948] Hash#to_query: right serialization for empty hash and array | |||||
| * | [Fixes #14948] Hash#to_query: Changed a way how empty hash and empty array ↵ | Bogdan Gusiev | 2014-05-03 | 1 | -6/+6 | |
| | | | | | | | | | | | | | | | | | | | | | | are serialized Empty Hash or Array should not present in serialization result {a: []}.to_query # => "" {a: {}}.to_query # => "" For more info see #14948. | |||||
* | | Remove deprecated file(`active_support/core_ext/object/to_json.rb`) and its ↵ | Kuldeep Aggarwal | 2014-05-04 | 1 | -5/+0 | |
|/ | | | | test case. | |||||
* | Object#duplicable? | Akshay Vishnoi | 2014-04-16 | 1 | -0/+3 | |
| | | | | | | 1. Improve tests 2. Remove unnecessary constant 3. Add docs for BigDecimal#duplicable? | |||||
* | Fix #to_json for BasicObject Enumerables | Sammy Larbi | 2014-03-14 | 2 | -2/+2 | |
| | ||||||
* | Go with #presence_in instead of #present_in -- it doesnt sound quite as ↵ | David Heinemeier Hansson | 2014-02-24 | 1 | -2/+2 | |
| | | | | good, but the closer relationship to #presence over #present is ultimately worth it | |||||
* | Added Object#present_in to simplify value whitelisting | David Heinemeier Hansson | 2014-02-18 | 1 | -0/+12 | |
| | ||||||
* | Fix to_query with empty arrays too | Rafael Mendonça França | 2014-02-06 | 1 | -1/+6 | |
| | ||||||
* | Refatoring the method to avoid shot-circuit return | Rafael Mendonça França | 2014-02-05 | 1 | -4/+7 | |
| | ||||||
* | Fixed "Hash#to_param confused by empty hash values #13892" | Hincu Petru | 2014-02-05 | 1 | -0/+1 | |
| |