Commit Graph

4 Commits

Author SHA1 Message Date
Type-kun
1375cc5307 Added privilege check for seeing flagger usernames
Also reworked all places dealing with flagger names to use said privilege
2017-06-14 20:43:25 +05:00
evazion
47ecf034a7 /posts/:id/events - fix exception when viewed by mod.
NoMethodError exception raised

    undefined method `creator' for #<PostEvent:0x007f9a298e64d8> Did you mean? creator_id
    app/views/post_events/index.html.erb:23:in `block in _app_views_post_events_index_html_erb__2088986421112502721_70150054247640'
    app/views/post_events/index.html.erb:18:in `each'
    app/views/post_events/index.html.erb:18:in `_app_views_post_events_index_html_erb__2088986421112502721_70150054247640'
    app/controllers/post_events_controller.rb:6:in `index'
2017-03-21 17:17:18 -05:00
evazion
5ba1df5502 /posts/:id/events: list is_resolved correctly for appeals.
/posts/:id/events incorrectly lists appeals as always being resolved.
This is because events UNION together appeals and flags, which doesn't
quite work because for appeals is_resolved is a method, not an
attribute. is_resolved was hardcoded to true so it'd work in the UNION.

This changes PostEvent to be a wrapper object around PostFlag /
PostAppeal, instead of a UNION. PostEvent delegates everything to the
inner flag/appeals object, so that is_resolved works correctly.

Also, this incidentally fixes a problem with /posts/:id/event.xml not
serializing correctly.
2017-03-19 22:47:10 -05:00
r888888888
f483d0e7a8 add combined flag+appeal listing for posts #262 2015-07-28 15:45:01 -07:00