Skip to content

Usage of "chain" and "filter" in Ruby 2.6 #24

Description

@olliebennett

Ruby 2.6.0 was released this week, and introduces Enumerator::Chain and Enumerable#filter.

The filterer gem already implements the chain and filter methods on an ActiveRecord collection.

On older rubies (<2.6) everything works fine;

# Ruby 2.5.x
> User.where('1=1').chain
=> [#<User:0x00007fe8bbf5f9c3 ... etc as expected.

However, on new rubies (>2.6.0) we see the following problem;

# Ruby 2.6.0
> User.where('1=1').chain
=> #<Enumerator::Chain: ...>

It seems the simplest solution is to rename or avoid the .chain and .filter methods in this gem.

Thoughts?

Activity

  1. changed the title [-]Usage with Ruby `2.6.0`.[/-] [+]Usage with Ruby `2.6.0` and "chain".[/+] on Dec 29, 2018
  2. olliebennett commented on Apr 16, 2019

    @olliebennett
    ContributorAuthor

    In my PR (aptly numbered #26), I've worked around this Ruby 2.6 conflict with the following method renames;

    filter -> filterer
    chain -> filterer_chain
    
  3. changed the title [-]Usage with Ruby `2.6.0` and "chain".[/-] [+]Usage of "chain" and "filter" in Ruby 2.6[/+] on May 31, 2019
  4. ramontayag commented on Mar 9, 2020

    @ramontayag

    @olliebennett looks like you have the active fork. @ajb what are the chances of getting him as a maintainer or at least with access?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions