Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Change wording of some instances of 'opt out' [ci skip] | Sharang Dashputre | 2019-03-12 | 2 | -10/+10 |
| | |||||
* | Remove deprecated `Module#reachable?` method | Rafael Mendonça França | 2019-01-17 | 1 | -6/+1 |
| | |||||
* | Clarify `delegate_missing_to` [ci skip] | bogdanvlviv | 2019-01-04 | 1 | -1/+1 |
| | | | | | | | | Since #34864 removed explicit receiver to clarify the purpose of `delegate_missing_to`, I think it will be better to do the same a few lines above to easier figure out that `delegate_missing_to` defines `method_missing`, `respond_to_missing?` when comparing these examples. | ||||
* | Clarify benefit of `delegate_missing_to` | Michael Gee | 2019-01-04 | 1 | -1/+1 |
| | | | Removing the explicit receiver clarifies the purpose of `delegate_missing_to`. | ||||
* | Clarify the :to parameter of delegate | Eddie Lebow | 2018-12-20 | 1 | -1/+1 |
| | |||||
* | Consistently use kwargs for `instance_{reader,writer,accessor}` options | Ryuta Kamizono | 2018-10-20 | 1 | -12/+7 |
| | | | | | | | | Since #29294, `mattr_acessor` uses kwargs for `instance_reader`, `instance_writer`, and `instance_accessor` options. `thread_mattr_accessor` and `config_accessor` also take the same options, so let's maintain these options handles the same. | ||||
* | attribute_accessors no longer uses extract_options since ↵ | Akira Matsuda | 2018-10-20 | 1 | -2/+0 |
| | | | | a5b0c60714e1e8d8c182af830a26e1c7c884271d | ||||
* | Prefix Module#parent, Module#parents, and Module#parent_name with module | Gannon McGibbon | 2018-10-02 | 1 | -13/+37 |
| | |||||
* | Fix example in thread_mattr_accessor documentation | Fabian Mersch | 2018-07-31 | 1 | -1/+1 |
| | |||||
* | Remove unused `require "active_support/core_ext/regexp"` | Ryuta Kamizono | 2018-07-29 | 3 | -3/+0 |
| | | | | | | | | Ruby 2.4 has native `Regexp#match?`. https://ruby-doc.org/core-2.4.0/Regexp.html#method-i-match-3F Related #32034. | ||||
* | Inclusive Language in Documentation Examples [ci skip] | Cassidy Kobewka | 2018-04-15 | 1 | -2/+2 |
| | |||||
* | [ci skip] Add :private option to delegation doc | Yoshiyuki Hirano | 2018-04-05 | 1 | -1/+2 |
| | |||||
* | [ci skip] Fix grammar in delegate, private: true docs. | Kasper Timm Hansen | 2018-03-04 | 1 | -5/+4 |
| | | | | | | | | | Convert the user to atheism by ditching the extra example that demonstrates the same thing as date_of_birth. Demonstrate the NoMethodError on date_of_birth first, then call age that uses date_of_birth internally. Thus showing that accessing it publicly fails, but using it internally succeeds. | ||||
* | Add separate test to ensure that `delegate` with `:private` option returns ↵ | bogdanvlviv | 2018-02-28 | 1 | -5/+5 |
| | | | | | | | | correct value Remove extra comments `# Asking for private method` in activesupport/test/core_ext/module_test.rb Improve docs of using `delegate` with `:private` Update changelog of #31944 | ||||
* | add private: true option for ActiveSupport delegate | Tomas Valent | 2018-02-26 | 1 | -2/+23 |
| | |||||
* | Rails 6 requires Ruby 2.3+ | Jeremy Daer | 2018-02-17 | 1 | -17/+8 |
| | |||||
* | Remove undefined `track_deletion` callback [ci skip] | Ryuta Kamizono | 2018-01-03 | 1 | -3/+0 |
| | |||||
* | Clarify docs for delegate :allow_nil option | Jay Hayes | 2017-12-15 | 1 | -5/+2 |
| | |||||
* | [ci skip] Make Todo classes inherit ApplicationRecord | Yoshiyuki Hirano | 2017-12-07 | 1 | -5/+5 |
| | | | | | Example codes that use `has_many` or `before_create` in `Module::Concerning` look like active record models. So I've made them inherit `ApplicationRecord`. | ||||
* | [Active Support] require_relative => require | Akira Matsuda | 2017-10-21 | 7 | -10/+10 |
| | | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc | ||||
* | Deprecate `Module#reachable?` method | bogdanvlviv | 2017-09-17 | 1 | -0/+1 |
| | |||||
* | Self-alias doesn't suppress the warning on Ruby 2.2 | Matthew Draper | 2017-09-01 | 1 | -8/+17 |
| | |||||
* | Clarify intentions around method redefinitions | Matthew Draper | 2017-09-01 | 2 | -23/+43 |
| | | | | | | | | | Don't use remove_method or remove_possible_method just before a new definition: at best the purpose is unclear, and at worst it creates a race condition. Instead, prefer redefine_method when practical, and silence_redefinition_of_method otherwise. | ||||
* | Test for the new exception of delegate_missing_to (#30191) | Anton Khamets | 2017-08-12 | 1 | -3/+9 |
| | | | | | | | | | | | | | | | * Add test for the new exception of delegate_missing_to * Add a changelog entry * Only check for nil if NoMethodError was raised * Make method private * Have to pass both target name and value * Inline the re-raise [Rafael Mendonça França + Anton Khamets] | ||||
* | Extend image_tag to accept ActiveStorage Attachments and Variants (#30084) | Anton Khamets | 2017-08-07 | 1 | -0/+2 |
| | | | | | | | | | | | | | | | | | | * Extend image_tag to accept ActiveStorage's Attachments and Variants * Flip resolve_image_source around * Add tests for the new use-cases of image_tag * Remove the higher-level test * Update image_tag documentation * Add error states into the test suite * Re-raise polymorhic_url's NoMethodError as ArgumentError * delegate_missing_to will raise DelegationError instead of NoMethodError | ||||
* | [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` | Koichi ITO | 2017-07-11 | 11 | -0/+11 |
| | |||||
* | Merge pull request #29728 from kirs/frozen-activesupport | Matthew Draper | 2017-07-09 | 11 | -0/+11 |
|\ | | | | | Use frozen-string-literal in ActiveSupport | ||||
| * | Use frozen-string-literal in ActiveSupport | Kir Shatrov | 2017-07-09 | 11 | -0/+11 |
| | | |||||
* | | Use `map` in `delegate` so that actual prefixed method names are returned, ↵ | Krzysztof Zych | 2017-07-05 | 1 | -1/+1 |
|/ | | | | if using prefix version. | ||||
* | [Active Support] require => require_relative | Akira Matsuda | 2017-07-01 | 6 | -9/+9 |
| | |||||
* | Implement mattr_acessor :default option | Genadi Samokovarov | 2017-06-03 | 1 | -24/+19 |
| | |||||
* | Assorted delegate_missing_to doc fixes | T.J. Schuck | 2017-05-04 | 1 | -22/+17 |
| | | | | | | | | | | | | * Fix rdoc code formatting — `tt`, not backticks * Fix/simplify sentence grammar — should at least just be “and the like”, not “likes”, but this is just general tightening up. * Add note that delegated methods must be public. Tested here: https://github.com/rails/rails/blob/7ff5ccae94ce2aff76b5f8a31a28e305a047d642/activesupport/test/core_ext/module_test.rb#L359-L365 * Simplify example code for delegate_missing_to. The example had complexity that wasn’t necessary for demonstrating `delegate_missing_to`. This gets rid of a bunch of cruft so the example is more obvious about what’s going on regarding the feature itself. [ci skip] | ||||
* | delegate_missing_to should fall back to super | Matthew Draper | 2017-04-09 | 1 | -1/+1 |
| | |||||
* | delegate_to_missing doesn't delegate private methods | Matthew Draper | 2017-04-09 | 1 | -1/+4 |
| | | | | So we shouldn't claim they're there, even when asked explicitly. | ||||
* | Not ants were harmed! 🐜 | Mario Uher | 2017-02-14 | 1 | -1/+1 |
| | |||||
* | Docs: Correction: Module::DelegationError | Jared Beck | 2017-02-03 | 1 | -7/+9 |
| | | | | | | | | | | | | | | | | When the delegation target is nil and the allow_nil option is not in use, a Module::DelegationError is raised. class C delegate :a, to: :b def b nil end end C.new.a # => Module::DelegationError: C#a delegated to b.a, but b is nil [ci skip] | ||||
* | Adjust `Module.parent_name` to work when frozen; fixes #27637 | Corey Ward | 2017-01-17 | 1 | -2/+4 |
| | |||||
* | Merge pull request #26480 from tbrisker/fix-26461 | Rafael França | 2017-01-04 | 1 | -2/+7 |
|\ | | | | | Clarify that mattr_* creates public methods | ||||
| * | Reword according to feedback | Tomer Brisker | 2016-09-15 | 1 | -8/+7 |
| | | |||||
| * | Clarify that mattr_* creates public methods | Tomer Brisker | 2016-09-13 | 1 | -0/+6 |
| | | |||||
* | | split DELEGATION_RESERVED_METHOD_NAMES in half | Toshimaru | 2016-12-09 | 1 | -4/+5 |
| | | |||||
* | | Remove deprecated method alias_method_chain | Andrew White | 2016-11-14 | 1 | -48/+0 |
| | | |||||
* | | Remove deprecated Module.qualified_const_get/set/defined? | Andrew White | 2016-11-14 | 1 | -70/+0 |
| | | |||||
* | | Remove deprecated module method_transplanting file | Andrew White | 2016-11-13 | 1 | -3/+0 |
| | | |||||
* | | Remove deprecated local_constants | Andrew White | 2016-11-13 | 1 | -8/+0 |
| | | |||||
* | | Add more rubocop rules about whitespaces | Rafael Mendonça França | 2016-10-29 | 1 | -1/+1 |
| | | |||||
* | | doc, hide non-public methods form the api docs. [ci skip] | Yves Senn | 2016-10-20 | 1 | -2/+2 |
|/ | | | | | | | | | This is a follow up to #25681, specifically this comment: https://github.com/rails/rails/pull/25681#issuecomment-238294002 The way the thread local variable is stored is an implementation detail and subject to change. It makes no sense to only generate a reader or writer as you'd have to know where to read from or where it writes to. | ||||
* | Fix typo in Delegation#delegate_missing_to doc [skip ci] | Anton Davydov | 2016-08-27 | 1 | -1/+1 |
| | |||||
* | Add three new rubocop rules | Rafael Mendonça França | 2016-08-16 | 1 | -2/+2 |
| | | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository. | ||||
* | Merge pull request #25570 from y-yagi/remove_useless_parameter | Eileen M. Uchitelle | 2016-08-15 | 1 | -3/+3 |
|\ | | | | | remove useless parameter |