This repository was archived by the owner on Aug 17, 2017. It is now read-only.
Allow parameter filters to match multi-parameter attributes#17
Closed
jpignata wants to merge 1 commit intorails:masterfrom
Closed
Allow parameter filters to match multi-parameter attributes#17jpignata wants to merge 1 commit intorails:masterfrom
jpignata wants to merge 1 commit intorails:masterfrom
Conversation
There was a problem hiding this comment.
Why not just use regexp for this?
keys.select do |key|
key.match /#{filter}\(\d+i\)/
end
Author
There was a problem hiding this comment.
#index was the fastest way to figure it out when I measured different approaches. I agree it's cleaner with a Regexp though.
There was a problem hiding this comment.
i found regexp are almost always faster than anything when it comes to strings. maybe with other regexp it will be faster:
key.match /\A#{filter}\(\d{1}i\)\z/i
Member
|
I'd rather we just default to permit :published_at will also just automatically allow :published_at(x) -- instead of all this extra configuration. If you want to take a stab at a pull request that does that, please open a new ticket. I posted the same message to pull request #21. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We're using the DateHelper in our application so in some places our permit list includes things like:
This change matches multi-parameter attributes based upon the head of the key so you can just include
:published_atin the above example.