acts-as-readable rails plugin issue
i'm controlling intridea's acts readable rails plugin messaging component i'm now building.
i've tangible summary category accordingly:
class post < activerecord::base
acts-as-readable
end
and all seems operative according plan, nonetheless perplexing app arrangement unread messages summary view, i run problems.
their example: (i've altered underscores hyphens due formatting issues)
bob = user.find_by_name("bob")
bob.readings # => []
post.find_unread_by(bob) # => [<post 1>,<post 2>,<post 3>...]
post.find_read_by(bob) # => []
post.find(1).read_by?(bob) # => false
post.find(1).read_by!(bob) # => <reading 1>
post.find(1).read_by?(bob) # => true
post.find(1).users_who_read # => [<user bob>]
post.find_unread_by(bob) # => [<post 2>,<post 3>...]
post.find_read_by(bob) # => [<post 1>]
bob.readings # => [<reading 1>]
so seems i wanted list array unread messages sitting mailbox (for instance inbox (39) ), i should means something like:
<%= post.find_unread_by(current-user).count %>
but avail. i always seem stranded rudimentary perspective issues after everything's set.
any ideas?
Comments
Post a Comment