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

Merge attributes with wrapper_options #1301

Closed
wants to merge 3 commits into from

Conversation

herminiotorres
Copy link
Contributor

As described in the #1278 issue modified the method of merge_wrapper_options to support duplicated values.

  • If sending a new wrapper it returns the new.
  • If sending a new wrapper with same attributes merge with the older.

closes #1278

@rafaelfranca
Copy link
Collaborator

:shipit:. Please add a CHANGELOG entry.

@rafaelfranca
Copy link
Collaborator

We need to make the test conditional to the Rails version.

if ActionPack::VERSION::MAJOR == '4' && ActionPack::VERSION::MINOR >= '2'

@rafaelfranca rafaelfranca reopened this Oct 7, 2015
@rafaelfranca rafaelfranca force-pushed the hct-merge-wrapper-options branch from 0adaf41 to be19931 Compare October 7, 2015 23:52
Herminio Torres and others added 3 commits October 7, 2015 21:42
Improve `merge_wrapper_options` method support other
types with write, rewrite and merge attributes.
@rafaelfranca rafaelfranca force-pushed the hct-merge-wrapper-options branch from be19931 to 9d4e5cd Compare October 8, 2015 00:42
@rafaelfranca
Copy link
Collaborator

@herminiotorres :shipit:

oldval + Array(newval)
wrapper_options.merge(options) do |key, oldval, newval|
case key.to_s
when "class"
Copy link
Contributor

Choose a reason for hiding this comment

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

@rafaelfranca makes sense to freeze these Strings? ❄️

Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer to not, unless we have proof that this will improve significantly the performance of the application.

@herminiotorres herminiotorres removed their assignment Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

merge_wrapper_options - missing keys
3 participants