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

Allow multi-level STI #82

Closed
meacuna opened this issue Mar 21, 2017 · 0 comments
Closed

Allow multi-level STI #82

meacuna opened this issue Mar 21, 2017 · 0 comments

Comments

@meacuna
Copy link
Contributor

meacuna commented Mar 21, 2017

If you have this scenario

class User
    acts_as_reader
end
class A
    acts_as_readable on: :created_at
end

class A < B
end

class B < C
end

And try to do something like

user = User.create!
c = C.create!

# Assume A.last is the same record as c
a = A.last
a.mark_as_read!(for: user)
user.have_read?(c)
# Expect true, but got false

I think it has to do with readable_parent behaviour.

I made a pull request to address this issue.

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

1 participant