Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | | pass the actual filter, not a string | Aaron Patterson | 2013-05-13 | 1 | -1/+1 | |
| | | | ||||||
* | | | do not keep a reference to the chain in the callback objects | Aaron Patterson | 2013-05-10 | 1 | -12/+10 | |
| | | | ||||||
* | | | fix deprecation test | Aaron Patterson | 2013-05-10 | 1 | -0/+2 | |
| | | | ||||||
* | | | push merge code to the callback itself | Aaron Patterson | 2013-05-10 | 1 | -18/+10 | |
| | | | ||||||
* | | | dup the callback and set the chain | Aaron Patterson | 2013-05-10 | 1 | -8/+8 | |
| | | | ||||||
* | | | remove klass because it is not used | Aaron Patterson | 2013-05-10 | 1 | -9/+7 | |
| | | | ||||||
* | | | rename instance variables | Aaron Patterson | 2013-05-10 | 1 | -12/+14 | |
| | | | ||||||
* | | | push duplicates? logic to the instance | Aaron Patterson | 2013-05-10 | 1 | -16/+7 | |
| | | | ||||||
* | | | callback chain is in charge of the cache, so remove method based cache | Aaron Patterson | 2013-05-10 | 1 | -21/+0 | |
| | | | ||||||
* | | | __define_callbacks method is not necessary anymore | Aaron Patterson | 2013-05-10 | 1 | -8/+1 | |
| | | | ||||||
* | | | just run compiled callbacks since they are cached | Aaron Patterson | 2013-05-10 | 1 | -14/+4 | |
| | | | ||||||
* | | | cache compiled callbacks | Aaron Patterson | 2013-05-10 | 1 | -7/+27 | |
| | | | ||||||
* | | | use delegation over inheritance so we can figure when to cache / bust cache | Aaron Patterson | 2013-05-10 | 1 | -5/+22 | |
| | | | ||||||
* | | | fixing activemodel tests | Aaron Patterson | 2013-05-10 | 1 | -1/+2 | |
| | | | ||||||
* | | | use an environment object to hold state about the filter calls | Aaron Patterson | 2013-05-10 | 1 | -21/+41 | |
| | | | ||||||
* | | | object based callbacks cannot be duplicated | Aaron Patterson | 2013-05-10 | 1 | -7/+4 | |
| | | | ||||||
* | | | pass the run block as a normal variable to the rest of the callbacks | Aaron Patterson | 2013-05-10 | 1 | -12/+12 | |
| | | | ||||||
* | | | fixing more variable names | Aaron Patterson | 2013-05-10 | 1 | -10/+10 | |
| | | | ||||||
* | | | fix variable name | Aaron Patterson | 2013-05-10 | 1 | -6/+6 | |
| | | | ||||||
* | | | reduce the number of lambas | Aaron Patterson | 2013-05-10 | 1 | -5/+2 | |
| | | | ||||||
* | | | callback sequence is no longer used | Aaron Patterson | 2013-05-10 | 1 | -6/+0 | |
| | | | ||||||
* | | | no need for variable assignments, just pass the values in | Aaron Patterson | 2013-05-10 | 1 | -6/+2 | |
| | | | ||||||
* | | | make_lambda is never called with an Array | Aaron Patterson | 2013-05-10 | 1 | -2/+0 | |
| | | | ||||||
* | | | callbacks are wrapped with lambdas | Aaron Patterson | 2013-05-10 | 1 | -106/+76 | |
| | | | ||||||
* | | | remove dead code | Aaron Patterson | 2013-05-10 | 1 | -10/+0 | |
| | | | ||||||
* | | | fix method names | Aaron Patterson | 2013-05-10 | 1 | -40/+44 | |
| | | | ||||||
* | | | using lambas for the callback bodies | Aaron Patterson | 2013-05-10 | 1 | -32/+12 | |
| | | | ||||||
* | | | wrap all options in lambas | Aaron Patterson | 2013-05-10 | 1 | -7/+13 | |
| | | | ||||||
* | | | conditions in callbacks return consistent lambdas | Aaron Patterson | 2013-05-10 | 1 | -9/+43 | |
|/ / | ||||||
* | | use public send on the scope parameters | Aaron Patterson | 2013-05-08 | 1 | -1/+1 | |
| | | ||||||
* | | using strings as scopes is not used anywhere, so remove it | Aaron Patterson | 2013-05-08 | 1 | -1/+1 | |
| | | ||||||
* | | adding tests for lambdas as conditions | Aaron Patterson | 2013-05-08 | 1 | -1/+1 | |
| | | ||||||
* | | separate identification computation | Aaron Patterson | 2013-05-08 | 1 | -24/+18 | |
| | | ||||||
* | | separate filters from source code | Aaron Patterson | 2013-05-08 | 1 | -20/+31 | |
| | | ||||||
* | | if the callbacks are not the same class, they cannot be duplicates | Aaron Patterson | 2013-05-08 | 1 | -2/+6 | |
| | | ||||||
* | | fix object comparison case | Aaron Patterson | 2013-05-08 | 1 | -1/+5 | |
| | | ||||||
* | | polymorphic comparison operator | Aaron Patterson | 2013-05-08 | 1 | -11/+24 | |
| | | ||||||
* | | fix issue #10502, do not recompute method name for already-stringified ↵ | Sean Walbran | 2013-05-07 | 1 | -1/+1 | |
| | | | | | | | | object filter | |||||
* | | Revert "Merge pull request #10433 from ↵ | Jon Leighton | 2013-05-03 | 1 | -33/+11 | |
| | | | | | | | | | | | | | | | | | | | | wangjohn/making_callbacks_more_performant" This reverts commit 09751fdc847c25237891a8fcb0c2312e39bbe86d, reversing changes made to 6a5ab08d21c4284a05f5e34484b18a91d4e5c50c. This change caused a failure in actionpack/test/abstract/callbacks_test.rb. | |||||
* | | Improving the performance of callbacks by keeping a hash of the | wangjohn | 2013-05-02 | 1 | -11/+33 | |
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | callbacks in the CallbackChain, so you don't have to iterate over all callbacks when checking for duplicates. Benchmark results when the tests in activerecord/test/cases/associations_test.rb were run with and without the change: == On master (when scanning all of the callbacks): --------------------------------------------------------- % cumulative self self total time seconds seconds calls ms/call ms/call name --------------------------------------------------------- 1.85 9.26 0.82 18412 0.04 0.05 ActiveSupport::Callbacks::Callback#matches? 1.22 12.32 0.54 18412 0.03 0.08 ActiveSupport::Callbacks::Callback#duplicates? 0.93 14.61 0.41 19600 0.02 0.21 ActiveSupport::Callbacks::CallbackChain#remove_duplicates Finished tests in 1.217065s, 30.4010 tests/s, 53.4072 assertions/s. --------------------------------------------------------- == On my branch (when using a hash to check callback duplication): --------------------------------------------------------- % cumulative self self total time seconds seconds calls ms/call ms/call name --------------------------------------------------------- 0.15 29.63 0.06 1188 0.05 0.72 ActiveSupport::Callbacks::CallbackChain#handle_duplicates 0.00 40.50 0.00 84 0.00 0.12 ActiveSupport::Callbacks::Callback#matches? 0.00 40.50 0.00 84 0.00 0.12 ActiveSupport::Callbacks::Callback#duplicates? 0.00 40.50 0.00 91 0.00 0.22 ActiveSupport::Callbacks::CallbackChain#scan_and_remove_duplicates Finished tests in 1.117757s, 33.1020 tests/s, 58.1522 assertions/s. --------------------------------------------------------- | |||||
* | refactor initialization of array | Vipul A M | 2013-04-23 | 1 | -4/+1 | |
| | ||||||
* | remove redundant variable | Vipul A M | 2013-04-22 | 1 | -2/+0 | |
| | ||||||
* | Merge pull request #10096 from benofsky/fix_skipping_object_callback_filters | Rafael Mendonça França | 2013-04-21 | 1 | -2/+23 | |
|\ | | | | | Fixes skipping object callback filters | |||||
| * | Fixes skipping object callback filters | Ben McRedmond | 2013-04-04 | 1 | -2/+23 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to skip callbacks that are defined by objects, e.g. for `ActionController`: skip_after_filter MySpecialFilter Previously this didn't work due to a bug in how Rails compared callbacks in `Callback#matches?`. When a callback is compiled, if it's an object filter (i.e. not a method, proc, etc.), `Callback` now defines a method on `@klass` that is derived from the class name rather than `@callback_id`. So, when `skip_callback` tries to find the appropriate callback to remove, `Callback` can regenerate the method name for the filter object and return the correct value for `Callback#matches?`. | |||||
* | | extract array to a constant | Vipul A M | 2013-04-22 | 1 | -1/+3 | |
| | | ||||||
* | | Revert "Merge pull request #10034 from ↵ | Rafael Mendonça França | 2013-04-04 | 1 | -13/+1 | |
| | | | | | | | | | | | | | | | | | | benofsky/fix_skipping_object_callback_filters" This reverts commit c79c6980647eb76bfa52178711fb04ba7e9d403b, reversing changes made to ba4c27479add60b783a0e623c8a5d176c1dc9043. This broke all the tests. See https://travis-ci.org/rails/rails/builds/6061839 | |||||
* | | Fixes skipping object callback filters | Ben McRedmond | 2013-04-04 | 1 | -1/+13 | |
|/ | | | | | | | | | | | | | | | This allows you to skip callbacks that are defined by objects, e.g. for `ActionController`: skip_after_filter MySpecialFilter Previously this didn't work due to a bug in how Rails compared callbacks in `Callback#matches?`. When a callback is compiled, if it's an object filter (i.e. not a method, proc, etc.), `Callback` now defines a method on `@klass` that is derived from the class name rather than `@callback_id`. So, when `skip_callback` tries to find the appropriate callback to remove, `Callback` can regenerate the method name for the filter object and return the correct value for `Callback#matches?`. | |||||
* | change merge to merge! | Vipul A M | 2013-03-29 | 1 | -1/+1 | |
| | ||||||
* | only calculate next_id when we need a new method defined | Aaron Patterson | 2013-03-04 | 1 | -1/+2 | |
| | ||||||
* | Merge pull request #7376 from ↵ | Rafael Mendonça França | 2012-12-21 | 1 | -5/+29 | |
|\ | | | | | | | | | | | | | | | | | dmitriy-kiriyenko/fix-double-callback-in-same-statement Prevent callback from being set twice. Conflicts: activesupport/CHANGELOG.md |