liquid_feedback_frontend

annotate model/policy.lua @ 922:cae2a205da8b

Do not lock member privilege rows to avoid deadlocks in another function
author bsw
date Mon Sep 24 22:21:26 2012 +0200 (2012-09-24)
parents f3d6d08b0125
children bbe07befa4e4
rev   line source
bsw/jbe@0 1 Policy = mondelefant.new_class()
bsw/jbe@0 2 Policy.table = 'policy'
bsw/jbe@0 3
bsw/jbe@0 4 Policy:add_reference{
bsw/jbe@0 5 mode = '1m',
bsw/jbe@0 6 to = "Issue",
bsw/jbe@0 7 this_key = 'id',
bsw/jbe@0 8 that_key = 'policy_id',
bsw/jbe@0 9 ref = 'issues',
bsw/jbe@5 10 back_ref = 'policy'
bsw/jbe@0 11 }
bsw@193 12
bsw@193 13 function Policy:build_selector(args)
bsw@193 14 local selector = self:new_selector()
bsw@193 15 if args.active ~= nil then
bsw@193 16 selector:add_where{ "active = ?", args.active }
bsw@193 17 end
bsw@193 18 selector:add_order_by("index")
bsw@193 19 return selector
bsw@193 20 end
bsw@901 21
bsw@901 22 function Policy.object_get:free_timeable()
bsw@901 23 if self.discussion_time == nil and self.verification_time == nil and self.voting_time == nil then
bsw@901 24 return true
bsw@901 25 end
bsw@901 26 return false
bsw@901 27 end

Impressum / About Us