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

Rename AS::Callback#merge #18747

Merged
merged 1 commit into from
Feb 5, 2015
Merged

Conversation

vipulnsward
Copy link
Member

Callback#merge merges options for a callback skip instead of a callback. Renamed it to indicate what it actually does.

@@ -373,7 +373,7 @@ def initialize(name, filter, kind, options, chain_config)
def filter; @key; end
def raw_filter; @filter; end

def merge(chain, new_options)
def merge_skip_callback(chain, new_options)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe merge_conditional_options?

…ck. Renamed it to indicate what it actually does.
@vipulnsward
Copy link
Member Author

Sounds even better. Updated.

@@ -373,7 +373,7 @@ def initialize(name, filter, kind, options, chain_config)
def filter; @key; end
def raw_filter; @filter; end

def merge(chain, new_options)
def merge_conditional_options(chain, new_options)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are here, and merge_conditional_options new_options parameter can only have a if or unless option , I wonder if we should change this to keyargs: something like

def merge_conditional_options(chain, if: [], unless: [])

Not strong about tho, just a thought... @rafaelfranca WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason not to do so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not if a reserved word?

rafaelfranca added a commit that referenced this pull request Feb 5, 2015
@rafaelfranca rafaelfranca merged commit 459a9ea into rails:master Feb 5, 2015
@vipulnsward vipulnsward deleted the merge-skip-callback branch February 22, 2016 14:32
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

4 participants