osm 1.2.15.dev.1 → 1.2.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG.md +224 -221
  3. data/lib/osm/badge.rb +204 -102
  4. data/spec/osm/badge_spec.rb +217 -137
  5. data/version.rb +1 -1
  6. metadata +4 -4
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjFmYjY4MTk2NDUyYzEyNDJhNGE1ZTVhOGZhZTBiOWZhOTUwYzM3Zg==
4
+ MjY5Mjk4ZWNkMTdiOTYwNjEyNjMzZDE5ZDJlNDZkMDRlNDhlNjViZA==
5
5
  data.tar.gz: !binary |-
6
- ZmVjMjkwMDUwOWU3NzMzZGZiMmM3ZWI3MmFmYTVlMDA1ZjVlNTBkNw==
6
+ YzkwMDhiNTljM2M5MTk0M2Y0MTUyN2MyYmVmNThlN2JlN2IwNjcxOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDI5NzA5NzMxY2FhYmFmZDYxMTAwY2Y0MTBkMTZkYjhkZjUzZTMzYjJjZTU0
10
- N2RhOTU1OTViMTFiZGY5YzNjMjE4MWE0ZDFlMzIxZTUwNjE3OTI2YzBiYzll
11
- ODZjMmY3MjdkNjIzZDA5MGNmMjQyNTVhMWNhMWZkOTM5ODJhZTg=
9
+ YWRmZGI4YzdhOWVjNTk5NTYwNmM5OGQxMmJlYzNmYWQ4ZTcyNWE2ZDZlOTRj
10
+ NTA0MTJmYmQyZDA5MjVhNGJmYmE2YzZhNjZlZDE4MGRjY2U2YjA5ZTEyMGYw
11
+ OTc5ZDJjYmJhMjQ0NTRjMjNmMDM3Y2E0MWQyZmFjODY1ODUwM2Y=
12
12
  data.tar.gz: !binary |-
13
- ZTczZjNmMDc1M2E3ZGJkYTVmZDJhM2VjYmFhOGVhODk5Y2E0ZWQwM2FlZTYx
14
- ZTM0MzJhMDZlY2VlZjM1ZmYwNzZkNjI1NzNjYmI0ZGRhZjQwZTlkNTUxODQ0
15
- YjVlYTU5ZGE3NDg0MTU1NTE4MTAxY2I4YjI1ZDQzMGU0NWRjZmY=
13
+ OGYyMzY1OWU5NDMzNzlmNTk0Mjk2Yzg0YjAwZjIyYjY0MWU1MWFkZGE3ZWE2
14
+ MjhhNGM1MmZmZGFmZWE4NDU4ZTc0MDk1MTBkYzlmNGIyMGU1MTliZTc1ZTBh
15
+ NTk4NjE3NmVhY2Y1ZjY5Mzg3MGM2OWNhMDQzYzI4YzE4YjA2OGQ=
data/CHANGELOG.md CHANGED
@@ -6,28 +6,31 @@
6
6
  * Retrieving badge stock
7
7
  * Updating badge stock
8
8
  * Fetching badge data
9
- * Fetching due badges (added stock\_levels attribute, since OSM now gives it)
9
+ * Fetching due badges (added stock_levels attribute, since OSM now gives it)
10
10
  * Fetching & updating badge links for Events
11
11
  * Fetching & updating badge links for Activities
12
12
  * Fetching & updating badge links for Meetings
13
13
  * Summary now returns all started/completed/awarded badges (it can't filter by type) so can only be called from Osm::Badge
14
14
  * Osm::Badge
15
- * osm\_key, osm\_long\_key and competion criteria attributes are gone
16
- * id, version, identifier, group\_name, latest, user\_id, levels, sharing attributes added
15
+ * osm_key, osm_long_key and competion criteria attributes are gone
16
+ * id, version, identifier, group_name, latest, user_id, levels, sharing attributes added
17
+ * min_modules_required, min_requirements_required, add_columns_to_module, level_requirement, other_requirements_required, badges_required, show_level_letters, requires_modules and modules attributes added
17
18
  * OSM Changed how completion criteria are retrieved (this gem now uses a special peice of OSM's API just for this purpose) so:
18
- * Osm::Badge attributes sections\_needed, total\_needed and needed\_from\_section are gone
19
- * New methods modules, module_letters and module_ids
19
+ * attributes sections_needed, total_needed and needed_from_section are gone
20
+ * New methods modules, module_letters, module_ids and add_columns?
20
21
  * Osm::Badge::Data
21
- * mark\_awarded method now only marks as awarded (the optional mark\_as parameter is gone)
22
- * mark\_not\_awarded method added
23
- * mark\_due and mark\_not\_due methods added
22
+ * mark_awarded method now only marks as awarded (the optional mark_as parameter is gone)
23
+ * mark_not_awarded method added
24
+ * mark_due and mark_not_due methods added
24
25
  * completed attribute renamed to due
25
26
  * sections_gained method renamed to modules_gained, now returns an array of letters
26
27
  * gained_in_sections renamed to gained_in_modules
28
+ * Osm::Badge::Requirement gains a mod attribute to hold the Osm::Badge::RequirementModule
29
+ * Osm::Badge::RequirementModule added
27
30
  * Osm::Event::BadgeLink
28
- * Attributes added: badge\_name, badge\_id, badge\_version, requirement\_id
29
- * Attributes removed: badge\_label, badge\_key, requirement\_key
30
- * Attributes untouched: badge\_type, badge\_section, data, requirement\_label
31
+ * Attributes added: badge_name, badge_id, badge_version, requirement_id
32
+ * Attributes removed: badge_label, badge_key, requirement_key
33
+ * Attributes untouched: badge_type, badge_section, data, requirement_label
31
34
  * Osm::Activity::Badge attributes now match Osm::Event::BadgeLink
32
35
  * Osm::Meeting::BadgeLink attributes now match Osm::Event::badgeLink
33
36
  * Osm::Badges.get_badge_stock returns a Hash, keys are now "#{badge_id}_#{level}"
@@ -39,13 +42,13 @@
39
42
 
40
43
  ## Version 1.2.13
41
44
 
42
- * Fix event.get\_attendance ignoring term in building the cache key
45
+ * Fix event.get_attendance ignoring term in building the cache key
43
46
 
44
47
  ## Version 1.2.12
45
48
 
46
49
  * Add leader? method to member (true if member is in the leaders grouping)
47
50
  * Add youth? method to member (true if member is in a non-leaders grouping)
48
- * Adjust Osm::Event::BadgeLink attributes (label becomes requirement\_label, add badge\_label)
51
+ * Adjust Osm::Event::BadgeLink attributes (label becomes requirement_label, add badge_label)
49
52
 
50
53
  ## Version 1.2.11
51
54
 
@@ -53,7 +56,7 @@
53
56
  * Add retrieving of badge links to events
54
57
  * When creating an event in OSM badge links are also added
55
58
  * When updating an event in OSM badge links are also updated
56
- * Add get\_list method to Event (get basic event details, should cutout the need to get all events all the time)
59
+ * Add get_list method to Event (get basic event details, should cutout the need to get all events all the time)
57
60
 
58
61
  ## Version 1.2.10
59
62
 
@@ -62,11 +65,11 @@
62
65
 
63
66
  ## Version 1.2.9
64
67
 
65
- * Add osm\_long\_key to badges to make getting badge stock easier
68
+ * Add osm_long_key to badges to make getting badge stock easier
66
69
 
67
70
  ## Version 1.2.8
68
71
 
69
- * api.get\_user\_permissions now includes the quartermaster permission
72
+ * api.get_user_permissions now includes the quartermaster permission
70
73
  * Fix administer permission level excluded from ApiAccess
71
74
 
72
75
  ## Version 1.2.7
@@ -84,7 +87,7 @@
84
87
  ## Version 1.2.4
85
88
 
86
89
  * Remove support for ruby 1.9.2 (listen gem requires >= 1.9.3)
87
- * Activity's get\_badge\_requirements method now will iterate through activities if there's no permission to use the existing one OSM query trick
90
+ * Activity's get_badge_requirements method now will iterate through activities if there's no permission to use the existing one OSM query trick
88
91
  * Fix exception when OSM returns a number (instead of a string) for total/completed columns of a flexi record
89
92
 
90
93
  ## Version 1.2.3
@@ -93,33 +96,33 @@
93
96
 
94
97
  ## Version 1.2.2
95
98
 
96
- * Add base\_url method to Api class and instances
99
+ * Add base_url method to Api class and instances
97
100
  * Add get_photo method to member
98
101
  * Add earnt and earnt? methods to Osm::Badge::Data to get the stage which has been earnt (based on the requirements hash)
99
102
 
100
103
  ## Version 1.2.1
101
104
 
102
- * Add section\_id read-only attribute to Osm::Error::NoCurrentTerm
105
+ * Add section_id read-only attribute to Osm::Error::NoCurrentTerm
103
106
 
104
107
  ## Version 1.2.0
105
108
 
106
109
  * Trying to fetch the currrent Term for a Section which doesn;t have one now raises an Osm::Error::NoCurrentTerm instead of an Osm::Error
107
110
  * Add personal details options to Section:
108
- * myscout\_details attribute [Boolean] for whether personal details are enabled
109
- * myscout\_details\_expires attribute [Date] for expiry date of subscription
110
- * myscout\_details\_email\_changes\_to attribute [String] where to send update emails to
111
+ * myscout_details attribute [Boolean] for whether personal details are enabled
112
+ * myscout_details_expires attribute [Date] for expiry date of subscription
113
+ * myscout_details_email_changes_to attribute [String] where to send update emails to
111
114
  * Osm::Member
112
- * myscout\_link method now accepts :details to get a link to the "Perosnal details" page
113
- * myscout\_link method can now link to a specific event by also passing in the id (optional 3rd parameter)
114
- * Addition of myscout\_link\_key method to get the member's unique key for use in myscout links
115
+ * myscout_link method now accepts :details to get a link to the "Perosnal details" page
116
+ * myscout_link method can now link to a specific event by also passing in the id (optional 3rd parameter)
117
+ * Addition of myscout_link_key method to get the member's unique key for use in myscout links
115
118
  * Osm::Section
116
- * subscription\_level\_name method is marked as depricated, ready for removal in version 2.0 -> replace with Osm::SUBSCRIPTION\_LEVEL\_NAMES[section.subscription\_level]
117
- * myscout\_programme\_show attribute added - how much of the programme do parents see?
119
+ * subscription_level_name method is marked as depricated, ready for removal in version 2.0 -> replace with Osm::SUBSCRIPTION_LEVEL_NAMES[section.subscription_level]
120
+ * myscout_programme_show attribute added - how much of the programme do parents see?
118
121
  * Addition of two new constants:
119
- * Osm::SUBSCRIPTION\_LEVEL\_NAMES - an Array of Strings containing the human name of each subscription level (starts with "Unknown" to make indexing work nicely)
120
- * Osm::SUBSCRIPTION\_LEVELS - an Array of Symbols for each level (starts with nil to make indexing work nicely)
121
- * Register - get\_structure now only includes dates
122
- * Addition of attendance\_reminder attribute to event
122
+ * Osm::SUBSCRIPTION_LEVEL_NAMES - an Array of Strings containing the human name of each subscription level (starts with "Unknown" to make indexing work nicely)
123
+ * Osm::SUBSCRIPTION_LEVELS - an Array of Symbols for each level (starts with nil to make indexing work nicely)
124
+ * Register - get_structure now only includes dates
125
+ * Addition of attendance_reminder attribute to event
123
126
  * Abillity to send Sms messages to multiple numbers
124
127
  * Add Gift Aid:
125
128
  * Get Payments
@@ -133,19 +136,19 @@
133
136
 
134
137
  ## Version 1.0.6
135
138
 
136
- * Add badge\_links to Meeting
137
- * Event.add\_column method gains a required attirbute (default false) to control whether parents are required to enter something
138
- * Event::Column gains parent\_required attribute (default false)
139
- * Event::Attendance gains get\_audit\_trail(api) method
139
+ * Add badge_links to Meeting
140
+ * Event.add_column method gains a required attirbute (default false) to control whether parents are required to enter something
141
+ * Event::Column gains parent_required attribute (default false)
142
+ * Event::Attendance gains get_audit_trail(api) method
140
143
 
141
144
  ## Version 1.0.5
142
145
 
143
- * Fix undefined method youth\_section? within Model.require\_ability\_to
146
+ * Fix undefined method youth_section? within Model.require_ability_to
144
147
 
145
148
  ## Version 1.0.4
146
149
 
147
150
  * Add notice board option to getting My.SCOUT link for a member (pass :notice as the parameter)
148
- * Model.require\_ability\_to now only checks subscription level for youth sections
151
+ * Model.require_ability_to now only checks subscription level for youth sections
149
152
 
150
153
  ## Version 1.0.3
151
154
 
@@ -166,11 +169,11 @@
166
169
  ## Version 1.0.0
167
170
 
168
171
  * SMS text messages:
169
- * Section gains sms\_sent\_test, sms\_messages\_sent and sms\_messages\_remaining attributes
172
+ * Section gains sms_sent_test, sms_messages_sent and sms_messages_remaining attributes
170
173
  * Add Sms class:
171
- * With send\_sms(api, section\_id, member\_ids, all\_or\_one, source\_address, message) method
174
+ * With send_sms(api, section_id, member_ids, all_or_one, source_address, message) method
172
175
  * With DeliveryReport Model subclass
173
- * With get\_for\_section(api, section) class method
176
+ * With get_for_section(api, section) class method
174
177
 
175
178
  ## Version 0.6.3
176
179
 
@@ -193,37 +196,37 @@
193
196
  * Add due? method to tell if the badge is due
194
197
  * Add started? method to tell if the badge has been started
195
198
  * Add started method to tell which stage has been started
196
- * Add first\_name and last\_name attributes
197
- * Add mark\_awarded method
198
- * Add mark\_due method
199
+ * Add first_name and last_name attributes
200
+ * Add mark_awarded method
201
+ * Add mark_due method
199
202
  * Badge
200
- * Make get\_badge\_data\_for\_section an instance not class method (called get\_data\_for\_section)
201
- * Add get\_summary\_for\_section(api, section, term=nil, options={}) method
202
- * Add optional section\_type parameter to get\_badges\_for\_section method
203
+ * Make get_badge_data_for_section an instance not class method (called get_data_for_section)
204
+ * Add get_summary_for_section(api, section, term=nil, options={}) method
205
+ * Add optional section_type parameter to get_badges_for_section method
203
206
 
204
207
  ## Version 0.5.0
205
208
 
206
209
  * Code breaking changes to DueBadges:
207
- * The by\_member attribute now uses scout\_id as the key
208
- * Addition of member\_names attribute to allow fetching of members names (the old key for the by\_member attribute)
209
- * descriptions attribute has been renamed to badge\_names for consistency
210
+ * The by_member attribute now uses scout_id as the key
211
+ * Addition of member_names attribute to allow fetching of members names (the old key for the by_member attribute)
212
+ * descriptions attribute has been renamed to badge_names for consistency
210
213
  * Code breaking changes to Register and subclasses:
211
214
  * Register:
212
- * update\_attendance - :attendance option is now a Symbol not String (:yes, :unadvised\_absent or :advised\_absent)
215
+ * update_attendance - :attendance option is now a Symbol not String (:yes, :unadvised_absent or :advised_absent)
213
216
  * Register::Attendance:
214
217
  * attendance attribute is now a Hash of Date to Symbol (instead of to String)
215
218
  * Register::Attendance gains two helper methods:
216
- * present\_on?(date)
217
- * absent\_on?(date)
218
- * Add allow\_booking attribute to Event
219
- * Add myscout\_programme\_times attribute to Section
219
+ * present_on?(date)
220
+ * absent_on?(date)
221
+ * Add allow_booking attribute to Event
222
+ * Add myscout_programme_times attribute to Section
220
223
  * Cost attribute of Event is now checked to be either "TBC" or formatted to /\\A\\d+\\.\\d{2}\\Z/
221
- * Add cost\_tbc? method to Event
222
- * Add cost\_free? method to Event
224
+ * Add cost_tbc? method to Event
225
+ * Add cost_free? method to Event
223
226
 
224
227
  ## Version 0.4.2
225
228
 
226
- * Fix undefined variable "section\_id" when fetching notepad from cache
229
+ * Fix undefined variable "section_id" when fetching notepad from cache
227
230
 
228
231
  ## Version 0.4.1
229
232
 
@@ -233,32 +236,32 @@
233
236
  ## Version 0.4.0
234
237
 
235
238
  * Event::Attendance
236
- * Move fields['firstname'] to first\_name attribute
237
- * Move fields['lastname'] to last\_name attribute
238
- * Move fields['dob'] to date\_of\_birth attribute
239
+ * Move fields['firstname'] to first_name attribute
240
+ * Move fields['lastname'] to last_name attribute
241
+ * Move fields['dob'] to date_of_birth attribute
239
242
  * Move fields['attending'] to attending attribute
240
243
  * The keys for fields are now Fixnums not Strings
241
- * Addition of payment\_control and payments attributes
242
- * Addition of automatic\_payments? and manual\_payments? methods
243
- * Addition of is\_attending?, is\_not\_attending?, is\_invited? and is\_shown? methods
244
- * update(api, field\_id) method now updates only changed fields, becoming update(api)
244
+ * Addition of payment_control and payments attributes
245
+ * Addition of automatic_payments? and manual_payments? methods
246
+ * Addition of is_attending?, is_not_attending?, is_invited? and is_shown? methods
247
+ * update(api, field_id) method now updates only changed fields, becoming update(api)
245
248
  * Add :network Section type
246
249
  * Add custom inspect methods for:
247
250
  * Event::Attendance (replace event with event.id if present)
248
251
  * Event::Column (replace event with event.id if present)
249
- * FlexiRecord::Column (replace flexi\_record with flexi\_record.id)
250
- * FlexiRecord::Data (replace flexi\_record with flexi\_record.id)
251
- * Badge::Requirement (replace badge with badge.osm\_key)
252
- * Badge::Data (replace badge with badge.osm\_key)
252
+ * FlexiRecord::Column (replace flexi_record with flexi_record.id)
253
+ * FlexiRecord::Data (replace flexi_record with flexi_record.id)
254
+ * Badge::Requirement (replace badge with badge.osm_key)
255
+ * Badge::Data (replace badge with badge.osm_key)
253
256
 
254
257
  ## Version 0.3.0
255
258
 
256
259
  * Removal of DueBadges
257
- * Removal of get\_badge\_stock method from sections
260
+ * Removal of get_badge_stock method from sections
258
261
  * Addition of Badges model:
259
- * With get\_due\_badges(api, section, options={}) method
260
- * With get\_stock(api, section, options={}) method
261
- * With update\_stock(api, section, badge\_key, stock\_level) method
262
+ * With get_due_badges(api, section, options={}) method
263
+ * With get_stock(api, section, options={}) method
264
+ * With update_stock(api, section, badge_key, stock_level) method
262
265
  * Addition of Badge models:
263
266
  * CoreBadge
264
267
  * ChallengeBadge
@@ -266,37 +269,37 @@
266
269
  * ActivityBadge
267
270
  * All:
268
271
  * Inherit from Badge (do not use this class directly)
269
- * With get\_badges\_for\_section(api, section, options={}) method
270
- * With get\_badge\_data\_for\_section(api, section, badge, term=nil, options={}) method
272
+ * With get_badges_for_section(api, section, options={}) method
273
+ * With get_badge_data_for_section(api, section, badge, term=nil, options={}) method
271
274
  * Addition of Badge::Requirements class
272
275
  * Addition of Badge::Data class
273
276
  * With update(api) method
274
- * With total\_gained method
275
- * With sections\_gained method
276
- * With gained\_in\_sections method
277
+ * With total_gained method
278
+ * With sections_gained method
279
+ * With gained_in_sections method
277
280
  * FlexiRecord::Data now updates only changed fields
278
281
 
279
282
  ## Version 0.2.2
280
283
 
281
284
  * Add comparing and sorting (using <=>, <, <=, >, >= and between?) to each model
282
285
  * Activity - id then version
283
- * Activity::File - activity\_id then name
284
- * Activity::Version - activity\_id then version
286
+ * Activity::File - activity_id then name
287
+ * Activity::Version - activity_id then version
285
288
  * ApiAccess - id
286
289
  * Event - start, name then id (shortcuts, returning 0 if ids are equal)
287
290
  * Event::Column - event then id
288
291
  * Event::Attendance - event then row
289
- * FlexiRecord - section\_id then name
290
- * FlexiRecord::Column - flexi\_record then id (system ones first then user ones)
291
- * FlexiRecord::Data - flexi\_record, grouping\_id then member\_id
292
- * Grouping - section\_id then name
293
- * Meeting - section\_id, date, start\_time then id
294
- * Meeting::Activity - title then activity\_id
295
- * Member - section\_id, grouping\_id, grouping\_leader (descending), last\_name then first\_name
292
+ * FlexiRecord - section_id then name
293
+ * FlexiRecord::Column - flexi_record then id (system ones first then user ones)
294
+ * FlexiRecord::Data - flexi_record, grouping_id then member_id
295
+ * Grouping - section_id then name
296
+ * Meeting - section_id, date, start_time then id
297
+ * Meeting::Activity - title then activity_id
298
+ * Member - section_id, grouping_id, grouping_leader (descending), last_name then first_name
296
299
  * Register::Field - id
297
- * Register::Attendance - section\_id, grouping\_id, last\_name then first\_name
298
- * Section - group\_name, type (by age) then name
299
- * Term - section\_id, start then id
300
+ * Register::Attendance - section_id, grouping_id, last_name then first_name
301
+ * Section - group_name, type (by age) then name
302
+ * Term - section_id, start then id
300
303
 
301
304
  ## Version 0.2.0
302
305
 
@@ -305,38 +308,38 @@
305
308
  * You try to access a feature which you don't have the correct permissions for
306
309
  * You try to access a Section (or it's Grouping) you shouldn't be accessing
307
310
  * All Model classes:
308
- * Addition of changed\_attributes method to get a list of attributes which have changed
309
- * Addition of reset\_changed\_attributes method to reset the list of attributes which have changed
311
+ * Addition of changed_attributes method to get a list of attributes which have changed
312
+ * Addition of reset_changed_attributes method to reset the list of attributes which have changed
310
313
  * Activity
311
314
  * Check user has permission to view before returning from cache
312
- * Addition of osm\_link method to get the URL for viewing in OSM
315
+ * Addition of osm_link method to get the URL for viewing in OSM
313
316
  * Add updating of Grouping
314
317
  * Evening:
315
318
  * Rename to Meeting
316
- * Rename meeting\_date attribute to date
317
- * Rename get\_programme method to get\_for\_section
319
+ * Rename meeting_date attribute to date
320
+ * Rename get_programme method to get_for_section
318
321
  * Event:
319
- * Removal of add\_field method (use add\_column instead)
322
+ * Removal of add_field method (use add_column instead)
320
323
  * Removal of fields attribute (use columns instead)
321
324
  * FlexiRecord:
322
- * Addition of id, section\_id and name attributes (these no longer need to be passed to methods)
325
+ * Addition of id, section_id and name attributes (these no longer need to be passed to methods)
323
326
  * FlexiRecord::Field renamed to FlexiRecord::Column
324
327
  * The following methods are now instance not class methods:
325
- * get\_fields (also renamed to get\_columns)
326
- * add\_field (also renamed to add\_column)
327
- * get\_data
328
+ * get_fields (also renamed to get_columns)
329
+ * add_field (also renamed to add_column)
330
+ * get_data
328
331
  * The following methods have bceome instance methods of a subclasses:
329
- * update\_field (moved to column.update)
330
- * delete\_field (moved to column.delete)
331
- * update\_data (moved to data.update)
332
+ * update_field (moved to column.update)
333
+ * delete_field (moved to column.delete)
334
+ * update_data (moved to data.update)
332
335
  * Member:
333
336
  * Removal of grouping attribute
334
- * Removal of grouping\_label attribute
335
- * Addition of myscout\_link method (used to get the link to the member's My.SCOUT page)
337
+ * Removal of grouping_label attribute
338
+ * Addition of myscout_link method (used to get the link to the member's My.SCOUT page)
336
339
  * Section:
337
- * subscription\_level attribute is now a Fixnum not Symbol
338
- * Addition of subscription\_level\_name method to get the name of the subscription level for the section
339
- * flexi\_records attribute now contains an Array of Osm::FlexiRecord
340
+ * subscription_level attribute is now a Fixnum not Symbol
341
+ * Addition of subscription_level_name method to get the name of the subscription level for the section
342
+ * flexi_records attribute now contains an Array of Osm::FlexiRecord
340
343
  * "Under the hood" changes:
341
344
  * Instead of caching individual items and a list of items the gem now caches a list of IDs. This should reduce the cache size.
342
345
  * When updating items requires multiple OSM requests, now only updates what changed
@@ -346,44 +349,44 @@
346
349
  ## Version 0.1.17
347
350
 
348
351
  * Add comparison to Evening
349
- * Passing a Term to the get\_programme method of Evening is now optional
352
+ * Passing a Term to the get_programme method of Evening is now optional
350
353
 
351
354
  ## Version 0.1.16
352
355
 
353
356
  * Member's grouping attribute:
354
- * Renamed to grouping\_label
355
- * Virtual attribute grouping added (maps to grouping\_label currently) marked as depricated as it will use a Grouping object not a String in the future
357
+ * Renamed to grouping_label
358
+ * Virtual attribute grouping added (maps to grouping_label currently) marked as depricated as it will use a Grouping object not a String in the future
356
359
  * Fix exception when OSM returns empty string when requesting groupings for a section
357
360
  * Fix exception when OSM returns empty string when requesting register structure for a section
358
361
  * Fix updating of grouping for Member
359
- * Fix validation error for Member - a leader's joining\_in\_years is -1
362
+ * Fix validation error for Member - a leader's joining_in_years is -1
360
363
  * Add spaces and spaces? methods to Event
361
364
 
362
365
  ## Version 0.1.15
363
366
 
364
- * Rename grouping\_name attribute of Member to grouping
367
+ * Rename grouping_name attribute of Member to grouping
365
368
 
366
369
  ## Version 0.1.14
367
370
 
368
- * Fix grouping\_name attribute of Member not being set when getting data from OSM
371
+ * Fix grouping_name attribute of Member not being set when getting data from OSM
369
372
 
370
373
  ## Version 0.1.13
371
374
 
372
375
  * Add attendance limit attributes to Event:
373
- * attendance\_limit - Fixnum, 0 = no limit
374
- * attendance\_limit\_includes\_leaders Boolean
375
- * Add limited\_attendance? method to Event
376
+ * attendance_limit - Fixnum, 0 = no limit
377
+ * attendance_limit_includes_leaders Boolean
378
+ * Add limited_attendance? method to Event
376
379
  * Add setting of a section's notepad
377
380
  * Add updating of Activity
378
- * Add grouping\_name attribute to Member
381
+ * Add grouping_name attribute to Member
379
382
 
380
383
  ## Version 0.1.12
381
384
 
382
- * Attribute Section.myscout\_email\_address\_send defaults to an empty String
383
- * Attribute Section.myscout\_email\_address\_copy defaults to an empty String
384
- * Attribute Section.myscout\_email\_address\_send renamed to myscout\_email\_address\_from
385
+ * Attribute Section.myscout_email_address_send defaults to an empty String
386
+ * Attribute Section.myscout_email_address_copy defaults to an empty String
387
+ * Attribute Section.myscout_email_address_send renamed to myscout_email_address_from
385
388
  * Osm::Event::Column
386
- * Rename parent\_label attribute to label
389
+ * Rename parent_label attribute to label
387
390
  * Add update method to update OSM
388
391
  * Add delete method to update OSM
389
392
  * Osm::Evening
@@ -393,44 +396,44 @@
393
396
  * Now returns an Osm::Evening on success, nil on failure
394
397
  * Will now pass start time, finish time and title to OSM
395
398
  * Add activity to programme
396
- * Evening.add\_activity(api, activity, notes="")
397
- * Activity.add\_to\_programme(api, section, date, notes="")
399
+ * Evening.add_activity(api, activity, notes="")
400
+ * Activity.add_to_programme(api, section, date, notes="")
398
401
  * Osm::Member
399
402
  * Add create method to update OSM
400
403
  * Add update method to update OSM
401
404
  * Osm::FlexiRecord
402
- * Add add\_field method to add a field to the record in OSM
403
- * Add update\_field method to rename a field in OSM
404
- * Add delete\_field method to delete a field from OSM
405
- * Add update\_data method to update the data in OSM
405
+ * Add add_field method to add a field to the record in OSM
406
+ * Add update_field method to rename a field in OSM
407
+ * Add delete_field method to delete a field from OSM
408
+ * Add update_data method to update the data in OSM
406
409
 
407
410
  ## Version 0.1.11
408
411
 
409
412
  * Fix "can't convert Hash into String" occuring when some section's config is a Hash not a JSON encoded Hash
410
- * Remove num\_scouts attribute from Section (OSM always sets this to 999)
413
+ * Remove num_scouts attribute from Section (OSM always sets this to 999)
411
414
  * Add My.SCOUT related attributes to Section:
412
415
  * gocardless (Boolean) - does the section use gocardless
413
- * myscout\_events\_expires (Date) - when the subscription to Events in My.SCOUT expires
414
- * myscout\_badges\_expires (Date) - when the subscription to Badges in My.SCOUT expires
415
- * myscout\_programme\_expires (Date) - when the subscription to Badges in My.SCOUT expires
416
- * myscout\_events (Boolean) - whether the section uses the Events part of My.SCOUT
417
- * myscout\_badges (Boolean) - whether the section uses the Badges part of My.SCOUT
418
- * myscout\_programme (Boolean) - whether the section uses the Programme part of My.SCOUT
419
- * myscout\_payments (Boolean) - whether the section uses the Payments part of My.SCOUT
420
- * myscout\_emails (Hash of Symbol to Boolean) - which email addresses are linked to MyScout for each Member
421
- * myscout\_email\_address\_send (String, blank OK) - which email address to send My.SCOUT emails as
422
- * myscout\_email\_address\_copy (String, blank OK) - which email address to send copys of My.SCOUT emails to
423
- * myscout\_badges\_partial (Boolean) - Whether parents can see partially completed badges
424
- * myscout\_programme\_summary (Boolean) - Whether parents can see the summary of programme items
425
- * myscout\_event\_reminder\_count (Integer) - How many event reminders to send to parents who haven't responded
426
- * myscout\_event\_reminder\_frequency (Integer) - How many days to leave between event reminder emails
427
- * myscout\_payment\_reminder\_count (Integer) - How many payment reminders to send to parents who haven't paid yet
428
- * myscout\_payment\_reminder\_frequency (Integer) - How many days to leave between payment reminder emails
416
+ * myscout_events_expires (Date) - when the subscription to Events in My.SCOUT expires
417
+ * myscout_badges_expires (Date) - when the subscription to Badges in My.SCOUT expires
418
+ * myscout_programme_expires (Date) - when the subscription to Badges in My.SCOUT expires
419
+ * myscout_events (Boolean) - whether the section uses the Events part of My.SCOUT
420
+ * myscout_badges (Boolean) - whether the section uses the Badges part of My.SCOUT
421
+ * myscout_programme (Boolean) - whether the section uses the Programme part of My.SCOUT
422
+ * myscout_payments (Boolean) - whether the section uses the Payments part of My.SCOUT
423
+ * myscout_emails (Hash of Symbol to Boolean) - which email addresses are linked to MyScout for each Member
424
+ * myscout_email_address_send (String, blank OK) - which email address to send My.SCOUT emails as
425
+ * myscout_email_address_copy (String, blank OK) - which email address to send copys of My.SCOUT emails to
426
+ * myscout_badges_partial (Boolean) - Whether parents can see partially completed badges
427
+ * myscout_programme_summary (Boolean) - Whether parents can see the summary of programme items
428
+ * myscout_event_reminder_count (Integer) - How many event reminders to send to parents who haven't responded
429
+ * myscout_event_reminder_frequency (Integer) - How many days to leave between event reminder emails
430
+ * myscout_payment_reminder_count (Integer) - How many payment reminders to send to parents who haven't paid yet
431
+ * myscout_payment_reminder_frequency (Integer) - How many days to leave between payment reminder emails
429
432
  * Add new OSM attributes to Event:
430
433
  * notepad - the notepad shown in OSM
431
- * public\_notepad - the notepad shown on My.SCOUT
432
- * confirm\_by\_date - the last day that parents can change their child's attendance details
433
- * allow\_changes - whether parents can change their child's attendance details
434
+ * public_notepad - the notepad shown on My.SCOUT
435
+ * confirm_by_date - the last day that parents can change their child's attendance details
436
+ * allow_changes - whether parents can change their child's attendance details
434
437
  * reminders - whether reminder emails are sent
435
438
  * Osm::Event
436
439
  * Mark fields attribute as depricated
@@ -463,12 +466,12 @@
463
466
 
464
467
  ## Version 0.1.4
465
468
 
466
- * Osm::Model has new class method get\_user\_permission(api, section_id, permission)
469
+ * Osm::Model has new class method get_user_permission(api, section_id, permission)
467
470
  * API may return permissions value as a string not integer
468
471
 
469
472
  ## Version 0.1.3
470
473
 
471
- * Add get\_badge\_stock(api) to section
474
+ * Add get_badge_stock(api) to section
472
475
 
473
476
  ## Version 0.1.2
474
477
 
@@ -476,7 +479,7 @@
476
479
 
477
480
  ## Version 0.1.1
478
481
 
479
- * Add get\_options Hash to Model.get\_user\_permissions
482
+ * Add get_options Hash to Model.get_user_permissions
480
483
  * Bug fixes
481
484
 
482
485
  ## Version 0.1.0
@@ -484,82 +487,82 @@
484
487
  * Configuration is through Osm::configure not Osm::Api.configure and it takes a different Hash
485
488
  * Api.authorize returns a different Hash
486
489
  * Removal of Osm::Api methods:
487
- * get\_*
488
- * update\_*
489
- * create\_*
490
+ * get_*
491
+ * update_*
492
+ * create_*
490
493
  * EventAttendance is now Event::Attendance
491
494
  * Removal of Osm::Role
492
- * Osm::Section now has two new required attributes group\_id and group\_name
493
- * long\_name and full\_name methods should be replaced with something similar to "#{section.name} (#{section.group\_name})" in your own code
494
- * Section has a class method fetch\_user\_permissions(api) which returns a Hash (section\_id to permissions Hash)
495
- * Activity now has class method get(api, activity\_id)
495
+ * Osm::Section now has two new required attributes group_id and group_name
496
+ * long_name and full_name methods should be replaced with something similar to "#{section.name} (#{section.group_name})" in your own code
497
+ * Section has a class method fetch_user_permissions(api) which returns a Hash (section_id to permissions Hash)
498
+ * Activity now has class method get(api, activity_id)
496
499
  * ApiAccess: now has class methods
497
- * get\_all(api, section)
498
- * get(api, section, for\_api)
499
- * get\_ours(api, section) -> actually just calls get(api, section, api)
500
+ * get_all(api, section)
501
+ * get(api, section, for_api)
502
+ * get_ours(api, section) -> actually just calls get(api, section, api)
500
503
  * DueBadges now has a class method get(api, section)
501
504
  * Evening now has class methods:
502
- * get\_programme(api, section\_id, term\_id)
505
+ * get_programme(api, section_id, term_id)
503
506
  * create(api, parameters)
504
507
  * Evening now has instance methods:
505
508
  * update(api)
506
- * get\_badge\_requirements(api, evening)
509
+ * get_badge_requirements(api, evening)
507
510
  * Event now has class methods:
508
- * get\_for\_section(api, section)
509
- * get(api, section, event\_id)
511
+ * get_for_section(api, section)
512
+ * get(api, section, event_id)
510
513
  * create(api)
511
514
  * Event now has instance methods:
512
515
  * update(api)
513
516
  * delete(api)
514
- * get\_attendance(api)
515
- * add\_field(api, label)
517
+ * get_attendance(api)
518
+ * add_field(api, label)
516
519
  * Event now has a fields attribute
517
- * Event::Attendance has instance method update(api, field\_id)
520
+ * Event::Attendance has instance method update(api, field_id)
518
521
  * FlexiRecord has class methods:
519
- * get\_fields(api, section, flexi\_record\_id)
520
- * get\_data(api, section, flexi\_record\_id, term)
521
- * Grouping now has a class method get\_for\_section(api, section)
522
- * Member now has a class method to get\_for\_section(api, section\_id, term\_id)
522
+ * get_fields(api, section, flexi_record_id)
523
+ * get_data(api, section, flexi_record_id, term)
524
+ * Grouping now has a class method get_for_section(api, section)
525
+ * Member now has a class method to get_for_section(api, section_id, term_id)
523
526
  * Register now has class methods:
524
- * get\_structure(api, section)
525
- * get\_attendance(api, section)
526
- * update\_attendance(data)
527
+ * get_structure(api, section)
528
+ * get_attendance(api, section)
529
+ * update_attendance(data)
527
530
  * Section now has class methods:
528
- * get\_all(api)
529
- * get(api, section\_id)
530
- * Section now has instance method get\_notepad(api)
531
+ * get_all(api)
532
+ * get(api, section_id)
533
+ * Section now has instance method get_notepad(api)
531
534
  * Term now has class methods:
532
- * get\_all(api)
533
- * get(api, term\_id)
534
- * get\_for\_section(api, section\_id)
535
- * get\_current\_term\_for\_section(api, section\_id)
535
+ * get_all(api)
536
+ * get(api, term_id)
537
+ * get_for_section(api, section_id)
538
+ * get_current_term_for_section(api, section_id)
536
539
  * create(api, parameters)
537
540
  * Term now has instance method update(api)
538
541
 
539
542
  ## Version 0.0.26
540
543
 
541
544
  * Register - Update attendance
542
- * Add api.get\_badge\_requirements\_for\_evening
543
- * Add api.update\_register
545
+ * Add api.get_badge_requirements_for_evening
546
+ * Add api.update_register
544
547
  * Event:
545
- * Add api.ceate\_event
546
- * Add api.update\_event
547
- * Add api.delete\_event
548
- * Add api.add\_event\_field
548
+ * Add api.ceate_event
549
+ * Add api.update_event
550
+ * Add api.delete_event
551
+ * Add api.add_event_field
549
552
  * Event attendance:
550
- * Add api.get\_event
551
- * Add api.get\_event\_fields
552
- * Add api.get\_event\_attendance
553
- * Add api.update\_event\_attendance
553
+ * Add api.get_event
554
+ * Add api.get_event_fields
555
+ * Add api.get_event_attendance
556
+ * Add api.update_event_attendance
554
557
  * Fix "uninitialized constant Osm::Api::HTTParty"
555
558
 
556
559
  ## Version 0.0.25
557
560
 
558
561
  * FlexiRecordData, move these attributes to the fields hash:
559
- * first\_name => 'firstname'
560
- * last\_name => 'lastname'
562
+ * first_name => 'firstname'
563
+ * last_name => 'lastname'
561
564
  * age => 'age'
562
- * date\_of\_birth => 'dob'
565
+ * date_of_birth => 'dob'
563
566
  * completed => 'completed'
564
567
  * total => 'total'
565
568
 
@@ -569,12 +572,12 @@
569
572
 
570
573
  ## Version 0.0.23
571
574
 
572
- * get\_badge\_stock\_levels now returns a hash whoose values are Fixnum not String
575
+ * get_badge_stock_levels now returns a hash whoose values are Fixnum not String
573
576
 
574
577
  ## Version 0.0.22
575
578
 
576
- * Adjustments so DueBadge is similar enough to badge\_stock data to be useful:
577
- * by\_member Hash -> Keys are member's name (String), values are the badge key (String)
579
+ * Adjustments so DueBadge is similar enough to badge_stock data to be useful:
580
+ * by_member Hash -> Keys are member's name (String), values are the badge key (String)
578
581
  * descriptions Hash -> keys are the badge key (String), values are the badge name (String)
579
582
  * totals Hash -> keys are the badge key (String), values are the number required (Fixnum)
580
583
  * Badge keys are the same as are used in getting badge stock levels
@@ -584,29 +587,29 @@
584
587
 
585
588
  ## Version 0.0.21
586
589
 
587
- * Fix getting section\_id and grouping\_id for api.get\_members
590
+ * Fix getting section_id and grouping_id for api.get_members
588
591
 
589
592
  ## Version 0.0.20
590
593
 
591
- * Deprecation of api\_data option in api methods (raise a warning if used and adjust documentation)
594
+ * Deprecation of api_data option in api methods (raise a warning if used and adjust documentation)
592
595
  * Hide sesitive information when printing data sent to OSM in debug mode
593
596
  * Add archived attribute to Event
594
- * Add :include\_archived option to api.get\_events method
597
+ * Add :include_archived option to api.get_events method
595
598
  * Add retreival of Flexi Records
596
- * Make set\_user method of Api public
599
+ * Make set_user method of Api public
597
600
 
598
601
  ## Version 0.0.19
599
602
 
600
- * Fix caching error in api.get\_register\_data
603
+ * Fix caching error in api.get_register_data
601
604
 
602
605
  ## Version 0.0.18
603
606
 
604
607
  * Term's end attribute is now finish
605
608
  * Event's end attribute is now finish
606
- * Evening's evening\_id attribute is now id
609
+ * Evening's evening_id attribute is now id
607
610
  * DueBadge's totals attribute is now a method (totals are calculated each time rather than during initialization)
608
611
  * Added exception ArgumentIsInvalid (raised when argument.valid? is false when updating through the API)
609
- * The following models now use active\_attr:
612
+ * The following models now use active_attr:
610
613
  * Activity, Activity::File, Activity::Badge and Activity::Version
611
614
  * ApiAccess
612
615
  * DueBadges
@@ -628,23 +631,23 @@
628
631
 
629
632
  ## Version 0.0.16
630
633
 
631
- * -2 is a valid grouping\_id value (corrected in Grouping)
634
+ * -2 is a valid grouping_id value (corrected in Grouping)
632
635
 
633
636
  ## Version 0.0.15
634
637
 
635
638
  * Add :debug option to Api.configure
636
- * -2 is a valid grouping\_id value
637
- * Fix check of :section\_id in Member.initalize (apparently 0 is allowd in the API return data)
639
+ * -2 is a valid grouping_id value
640
+ * Fix check of :section_id in Member.initalize (apparently 0 is allowd in the API return data)
638
641
  * Fix role's section not being set from API data
639
642
 
640
643
  ## Version 0.0.14
641
644
 
642
- * Fix api.get_register\_data\ returning wrong object
643
- * Fix check of :num\_scouts in Section.initalize
645
+ * Fix api.get_register_data\ returning wrong object
646
+ * Fix check of :num_scouts in Section.initalize
644
647
 
645
648
  ## Version 0.0.13
646
649
 
647
- * Fix bug - invalid grouping\_leader in member incorrectly risen for -1
650
+ * Fix bug - invalid grouping_leader in member incorrectly risen for -1
648
651
 
649
652
  ## Version 0.0.12
650
653
 
@@ -654,14 +657,14 @@
654
657
  * Activity.files now returns an array of Osm::Activity::File objects
655
658
  * Activity.versions now returns an array of Osm::Activity::Version objects
656
659
  * Section.flexi_records now returns an array of Osm::Section::FlexiRecord objects
657
- * api.get\_register\_structure now returns an array of RegisterField objects
658
- * api.get\_register becomes api.get\_register\_data and now returns an array of RegisterData objects
660
+ * api.get_register_structure now returns an array of RegisterField objects
661
+ * api.get_register becomes api.get_register_data and now returns an array of RegisterData objects
659
662
  * Attribute name changes:
660
- * Activity::Badge.section becomes section\_type
661
- * Activity::File.file\_id becomes id
662
- * Section.extra\_records becomes flexi\_records
663
- * Member.joined\_in\_years attribute becomes joining\_in\_years
664
- * from\_api method added to:
663
+ * Activity::Badge.section becomes section_type
664
+ * Activity::File.file_id becomes id
665
+ * Section.extra_records becomes flexi_records
666
+ * Member.joined_in_years attribute becomes joining_in_years
667
+ * from_api method added to:
665
668
  * Activity and sub classes
666
669
  * ApiAccess
667
670
  * DueBadges
@@ -677,18 +680,18 @@
677
680
 
678
681
  ## Version 0.0.11
679
682
 
680
- * Fix undefined variable in id\_for\_term
683
+ * Fix undefined variable in id_for_term
681
684
 
682
685
  ## Version 0.0.10
683
686
 
684
687
  * Fix handling an empty array being returned from OSM for fields (presumably if not allowed to view)
685
- * Fix undefined variable in id\_for\_term
688
+ * Fix undefined variable in id_for_term
686
689
 
687
690
  ## Version 0.0.9
688
691
 
689
692
  * Allow passing of Osm::Term objects as well as term IDs
690
693
  * Allow passing of Osm::Section objects as well as section IDs
691
- * Allow configuration of text prepended to keys used in the cache (:cache\_prepend\_to\_key option to configure method)
694
+ * Allow configuration of text prepended to keys used in the cache (:cache_prepend_to_key option to configure method)
692
695
  * Require setting of cache class to use caching (:cache option to configure method)
693
696
 
694
697
  ## version 0.0.8
@@ -704,7 +707,7 @@
704
707
  ## Version 0.0.6
705
708
 
706
709
  * Usage changes:
707
- * When calling an api.get\_\* method api_data is now passed as an additional paramter not as part of the options
710
+ * When calling an api.get_\* method api_data is now passed as an additional paramter not as part of the options
708
711
  * Work on documentation:
709
712
  * Tidy up params
710
713
  * Tidy up returns