liquid_feedback_frontend
view model/ignored_area.lua @ 1558:5e7d76a32227
Hide discard vote button after voting is closed
author | bsw |
---|---|
date | Tue Nov 10 20:23:37 2020 +0100 (2020-11-10) |
parents | 55132e0324a4 |
children |
line source
1 IgnoredArea = mondelefant.new_class()
2 IgnoredArea.table = 'ignored_area'
3 IgnoredArea.primary_key = { "member_id", "area_id" }
5 function IgnoredArea:by_pk(member_id, area_id)
6 return self:new_selector()
7 :add_where{ "member_id = ?", member_id }
8 :add_where{ "area_id = ?", area_id }
9 :optional_object_mode()
10 :exec()
11 end
13 function IgnoredArea:destroy_by_member_id(member_id)
14 local ignored_areas = self:new_selector()
15 :add_where{ "member_id = ?", member_id }
16 :exec()
17 for i, ignored_area in ipairs(ignored_areas) do
18 ignored_area:destroy()
19 end
20 end