Method: Osm::Activity#add_to_programme
- Defined in:
- lib/osm/activity.rb
#add_to_programme(api, section, date, notes = "") ⇒ Boolean
Add this activity to the programme in OSM
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/osm/activity.rb', line 207 def add_to_programme(api, section, date, notes="") require_ability_to(api, :write, :programme, section) data = api.perform_query("programme.php?action=addActivityToProgramme", { 'meetingdate' => date.strftime(Osm::OSM_DATE_FORMAT), 'activityid' => id, 'sectionid' => section.to_i, 'notes' => notes, }) if (data == {'result'=>0}) # The cached activity will be out of date - remove it cache_delete(api, ['activity', self.id]) return true else return false end end |