Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AS::Callbacks: remove __define_runner #4233

Merged
merged 1 commit into from
Dec 30, 2011
Merged

AS::Callbacks: remove __define_runner #4233

merged 1 commit into from
Dec 30, 2011

Conversation

bogdan
Copy link
Contributor

@bogdan bogdan commented Dec 30, 2011

I've suddenly realized that __define_runner method don't do anything right now: just define method that delegates work. Since this method is not part of the API - it can be omitted.

@josevalim
Copy link
Contributor

Are you sure this doesn't break the test suite? I believe the runner is being used in some places...

@bogdan
Copy link
Contributor Author

bogdan commented Dec 30, 2011

The need of runner came from the fact that previously caching was done only for keyed callback and there was a need to redefine runner for each set_callback call - it was dynamic. Now caching is done for everything. Runner method became static, that is why we don't need it and can call new _run_callbacks method directly that does the work(e.g. compilation caching).

-    def run_callbacks(kind, *args, &block)
-      send("_run_#{kind}_callbacks", *args, &block)
+    def run_callbacks(kind, key = nil, &block)
+      self.class.__run_callbacks(key, kind, self, &block)
     end

Anyway I've checked test suite for AP, AM and AR in order to ensure that everything is fine.

josevalim added a commit that referenced this pull request Dec 30, 2011
AS::Callbacks: remove __define_runner
@josevalim josevalim merged commit 4b99732 into rails:master Dec 30, 2011
@josevalim
Copy link
Contributor

Ok, merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants