Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Faster Hash#slice that doesn't use Enumerable#include?.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
- Loading branch information
952ec79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit has broke form helpers!
Now they generate something like name=“list[][name]” instead of name=“list[name]”.
All forms in my app are broken.
952ec79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
denis@denis-laptop:~/dev/ruby/rails/actionpack$ rake
1966 tests, 9460 assertions, 16 failures, 0 errors
952ec79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see http://github.com/methodmissing/rails/commit/fee25cfcb6c8a29ff1906d54ba849349f38ebedd for the fix
952ec79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the returning(…) syntax?
returning {} do |allowed|
allowed.each { |k| hash[k] = self[k] }
end
952ec79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We get shit for that (performance). Looks much nicer but I guess you don’t need it for really low level stuff like this.
952ec79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, thanks for the clarification.