liquid_feedback_frontend
annotate model/policy.lua @ 911:c0d17602fd8c
Added tag v2.1.0 for changeset e7cea3037d69
| author | bsw | 
|---|---|
| date | Sun Sep 23 17:11:03 2012 +0200 (2012-09-23) | 
| 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 |