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

StoreModel::Model#== cannot properly compare enums #28

Closed
FunkyloverOne opened this issue Aug 22, 2019 · 2 comments
Closed

StoreModel::Model#== cannot properly compare enums #28

FunkyloverOne opened this issue Aug 22, 2019 · 2 comments

Comments

@FunkyloverOne
Copy link

FunkyloverOne commented Aug 22, 2019

Here:

    def ==(other)
      return super unless other.is_a?(self.class)

      attributes.all? { |name, value| value == other.send(name) }
    end

The value in this case is going to be an integer, while the result of other.send(name) will be a string enum key.

@DmitryTsepelev
Copy link
Owner

Hi @FunkyloverOne, nice catch! Could you please take a look at my PR with the fix before I merge it?

@DmitryTsepelev
Copy link
Owner

Released in 0.5.2

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

No branches or pull requests

2 participants