osm 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/Rakefile +3 -1
- data/gemfiles/rails3 +13 -0
- data/lib/osm/activity.rb +18 -9
- data/lib/osm/api_access.rb +3 -1
- data/lib/osm/badge.rb +10 -4
- data/lib/osm/badges.rb +3 -1
- data/lib/osm/budget.rb +3 -1
- data/lib/osm/event.rb +12 -6
- data/lib/osm/flexi_record.rb +9 -3
- data/lib/osm/giftaid.rb +6 -2
- data/lib/osm/grouping.rb +3 -1
- data/lib/osm/invoice.rb +6 -2
- data/lib/osm/meeting.rb +11 -5
- data/lib/osm/member.rb +8 -6
- data/lib/osm/model.rb +1 -1
- data/lib/osm/register.rb +6 -2
- data/lib/osm/section.rb +13 -11
- data/lib/osm/sms.rb +3 -1
- data/lib/osm/term.rb +3 -1
- data/osm.gemspec +6 -6
- data/spec/osm/model_spec.rb +1 -1
- data/spec/osm/osm_spec.rb +2 -2
- data/version.rb +1 -1
- metadata +35 -10
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/gemfiles/rails3
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gem 'active_attr', '~> 0.8'
|
4
|
+
gem 'activemodel', '~> 3.2'
|
5
|
+
gem 'activesupport', '~> 3.2'
|
6
|
+
gem 'dirty_hashy', '~> 0.2.1'
|
7
|
+
gem 'httparty', '~> 0.9'
|
8
|
+
gem 'rake', '~> 10.1'
|
9
|
+
gem 'rspec', '~> 2.0', '< 2.14'
|
10
|
+
gem 'fakeweb', '~> 1.3.0'
|
11
|
+
gem 'osm', :path=>'../'
|
12
|
+
|
13
|
+
#gemspec :path=>"../"
|
data/lib/osm/activity.rb
CHANGED
@@ -67,9 +67,12 @@ module Osm
|
|
67
67
|
attribute :files, :default => []
|
68
68
|
attribute :badges, :default => []
|
69
69
|
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
if ActiveModel::VERSION::MAJOR < 4
|
71
|
+
attr_accessible :id, :version, :group_id, :user_id, :title, :description,
|
72
|
+
:resources, :instructions, :running_time, :location,
|
73
|
+
:shared, :rating, :editable, :deletable, :used, :versions,
|
74
|
+
:sections, :tags, :files, :badges
|
75
|
+
end
|
73
76
|
|
74
77
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0
|
75
78
|
validates_numericality_of :version, :only_integer=>true, :greater_than_or_equal_to=>0, :allow_nil=>true
|
@@ -263,7 +266,7 @@ module Osm
|
|
263
266
|
|
264
267
|
private
|
265
268
|
class File
|
266
|
-
include ActiveModel::MassAssignmentSecurity
|
269
|
+
include ActiveModel::MassAssignmentSecurity if ActiveModel::VERSION::MAJOR < 4
|
267
270
|
include ActiveAttr::Model
|
268
271
|
|
269
272
|
# @!attribute [rw] id
|
@@ -280,7 +283,9 @@ module Osm
|
|
280
283
|
attribute :file_name, :type => String
|
281
284
|
attribute :name, :type => String
|
282
285
|
|
283
|
-
|
286
|
+
if ActiveModel::VERSION::MAJOR < 4
|
287
|
+
attr_accessible :id, :activity_id, :file_name, :name
|
288
|
+
end
|
284
289
|
|
285
290
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0
|
286
291
|
validates_numericality_of :activity_id, :only_integer=>true, :greater_than=>0
|
@@ -301,7 +306,7 @@ module Osm
|
|
301
306
|
end # Class Activity::File
|
302
307
|
|
303
308
|
class Badge
|
304
|
-
include ActiveModel::MassAssignmentSecurity
|
309
|
+
include ActiveModel::MassAssignmentSecurity if ActiveModel::VERSION::MAJOR < 4
|
305
310
|
include ActiveAttr::Model
|
306
311
|
|
307
312
|
# @!attribute [rw] activity_id
|
@@ -324,7 +329,9 @@ module Osm
|
|
324
329
|
attribute :requirement, :type => String
|
325
330
|
attribute :label, :type => String
|
326
331
|
|
327
|
-
|
332
|
+
if ActiveModel::VERSION::MAJOR < 4
|
333
|
+
attr_accessible :activity_id, :section_type, :type, :badge, :requirement, :label
|
334
|
+
end
|
328
335
|
|
329
336
|
validates_numericality_of :activity_id, :only_integer=>true, :greater_than=>0
|
330
337
|
validates_presence_of :badge
|
@@ -342,7 +349,7 @@ module Osm
|
|
342
349
|
end # Class Activity::Badge
|
343
350
|
|
344
351
|
class Version
|
345
|
-
include ActiveModel::MassAssignmentSecurity
|
352
|
+
include ActiveModel::MassAssignmentSecurity if ActiveModel::VERSION::MAJOR < 4
|
346
353
|
include ActiveAttr::Model
|
347
354
|
|
348
355
|
# @!attribute [rw] version
|
@@ -359,7 +366,9 @@ module Osm
|
|
359
366
|
attribute :created_by_name, :type => String
|
360
367
|
attribute :label, :type => String
|
361
368
|
|
362
|
-
|
369
|
+
if ActiveModel::VERSION::MAJOR < 4
|
370
|
+
attr_accessible :version, :created_by, :created_by_name, :label
|
371
|
+
end
|
363
372
|
|
364
373
|
validates_numericality_of :version, :only_integer=>true, :greater_than_or_equal_to=>0
|
365
374
|
validates_numericality_of :created_by, :only_integer=>true, :greater_than=>0
|
data/lib/osm/api_access.rb
CHANGED
@@ -13,7 +13,9 @@ module Osm
|
|
13
13
|
attribute :name, :type => String
|
14
14
|
attribute :permissions, :default => {}
|
15
15
|
|
16
|
-
|
16
|
+
if ActiveModel::VERSION::MAJOR < 4
|
17
|
+
attr_accessible :id, :name, :permissions
|
18
|
+
end
|
17
19
|
|
18
20
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0
|
19
21
|
validates_presence_of :name
|
data/lib/osm/badge.rb
CHANGED
@@ -26,7 +26,9 @@ module Osm
|
|
26
26
|
attribute :needed_from_section, :type => Object
|
27
27
|
attribute :requirements, :type => Object
|
28
28
|
|
29
|
-
|
29
|
+
if ActiveModel::VERSION::MAJOR < 4
|
30
|
+
attr_accessible :name, :requirement_notes, :osm_key, :sections_needed, :total_needed, :needed_from_section, :requirements
|
31
|
+
end
|
30
32
|
|
31
33
|
validates_numericality_of :sections_needed, :only_integer=>true, :greater_than_or_equal_to=>-1
|
32
34
|
validates_numericality_of :total_needed, :only_integer=>true, :greater_than_or_equal_to=>-1
|
@@ -195,7 +197,7 @@ module Osm
|
|
195
197
|
|
196
198
|
|
197
199
|
class Requirement
|
198
|
-
include ActiveModel::MassAssignmentSecurity
|
200
|
+
include ActiveModel::MassAssignmentSecurity if ActiveModel::VERSION::MAJOR < 4
|
199
201
|
include ActiveAttr::Model
|
200
202
|
|
201
203
|
# @!attribute [rw] badge
|
@@ -215,7 +217,9 @@ module Osm
|
|
215
217
|
attribute :field, :type => String
|
216
218
|
attribute :editable, :type => Boolean
|
217
219
|
|
218
|
-
|
220
|
+
if ActiveModel::VERSION::MAJOR < 4
|
221
|
+
attr_accessible :name, :description, :field, :editable, :badge
|
222
|
+
end
|
219
223
|
|
220
224
|
validates_presence_of :name
|
221
225
|
validates_presence_of :description
|
@@ -271,7 +275,9 @@ module Osm
|
|
271
275
|
attribute :section_id, :type => Integer
|
272
276
|
attribute :badge, :type => Object
|
273
277
|
|
274
|
-
|
278
|
+
if ActiveModel::VERSION::MAJOR < 4
|
279
|
+
attr_accessible :member_id, :first_name, :last_name, :completed, :awarded, :awarded_date, :requirements, :section_id, :badge
|
280
|
+
end
|
275
281
|
|
276
282
|
validates_presence_of :badge
|
277
283
|
validates_presence_of :first_name
|
data/lib/osm/badges.rb
CHANGED
@@ -106,7 +106,9 @@ module Osm
|
|
106
106
|
attribute :by_member, :default => {}
|
107
107
|
attribute :member_names, :default => {}
|
108
108
|
|
109
|
-
|
109
|
+
if ActiveModel::VERSION::MAJOR < 4
|
110
|
+
attr_accessible :badge_names, :by_member, :member_names
|
111
|
+
end
|
110
112
|
|
111
113
|
validates :badge_names, :hash => {:key_type => String, :value_type => String}
|
112
114
|
validates :member_names, :hash => {:key_type => Fixnum, :value_type => String}
|
data/lib/osm/budget.rb
CHANGED
@@ -12,7 +12,9 @@ module Osm
|
|
12
12
|
attribute :section_id, :type => Integer
|
13
13
|
attribute :name, :type => String
|
14
14
|
|
15
|
-
|
15
|
+
if ActiveModel::VERSION::MAJOR < 4
|
16
|
+
attr_accessible :id, :section_id, :name
|
17
|
+
end
|
16
18
|
|
17
19
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :unless => Proc.new { |r| r.id.nil? }
|
18
20
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
data/lib/osm/event.rb
CHANGED
@@ -62,10 +62,12 @@ module Osm
|
|
62
62
|
attribute :attendance_reminder, :type => Integer, :default => 0
|
63
63
|
attribute :allow_booking, :type => Boolean, :default => true
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
if ActiveModel::VERSION::MAJOR < 4
|
66
|
+
attr_accessible :id, :section_id, :name, :start, :finish, :cost, :location, :notes, :archived,
|
67
|
+
:fields, :columns, :notepad, :public_notepad, :confirm_by_date, :allow_changes,
|
68
|
+
:reminders, :attendance_limit, :attendance_limit_includes_leaders,
|
69
|
+
:attendance_reminder, :allow_booking
|
70
|
+
end
|
69
71
|
|
70
72
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :allow_nil => true
|
71
73
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
@@ -432,7 +434,9 @@ module Osm
|
|
432
434
|
attribute :parent_required, :type => Boolean, :default => false
|
433
435
|
attribute :event
|
434
436
|
|
435
|
-
|
437
|
+
if ActiveModel::VERSION::MAJOR < 4
|
438
|
+
attr_accessible :id, :name, :label, :parent_required, :event
|
439
|
+
end
|
436
440
|
|
437
441
|
validates_presence_of :id
|
438
442
|
validates_presence_of :name
|
@@ -545,7 +549,9 @@ module Osm
|
|
545
549
|
attribute :payments, :default => {}
|
546
550
|
attribute :payment_control
|
547
551
|
|
548
|
-
|
552
|
+
if ActiveModel::VERSION::MAJOR < 4
|
553
|
+
attr_accessible :member_id, :grouping_id, :fields, :row, :event, :first_name, :last_name, :date_of_birth, :attending, :payments, :payment_control
|
554
|
+
end
|
549
555
|
|
550
556
|
validates_numericality_of :row, :only_integer=>true, :greater_than_or_equal_to=>0
|
551
557
|
validates_numericality_of :member_id, :only_integer=>true, :greater_than=>0
|
data/lib/osm/flexi_record.rb
CHANGED
@@ -12,7 +12,9 @@ module Osm
|
|
12
12
|
attribute :section_id, :type => Integer
|
13
13
|
attribute :name, :type => String
|
14
14
|
|
15
|
-
|
15
|
+
if ActiveModel::VERSION::MAJOR < 4
|
16
|
+
attr_accessible :id, :section_id, :name
|
17
|
+
end
|
16
18
|
|
17
19
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :unless => Proc.new { |r| r.id.nil? }
|
18
20
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
@@ -140,7 +142,9 @@ module Osm
|
|
140
142
|
attribute :name, :type => String
|
141
143
|
attribute :editable, :type => Boolean, :default => false
|
142
144
|
|
143
|
-
|
145
|
+
if ActiveModel::VERSION::MAJOR < 4
|
146
|
+
attr_accessible :flexi_record, :id, :name, :editable
|
147
|
+
end
|
144
148
|
|
145
149
|
validates_presence_of :flexi_record
|
146
150
|
validates_presence_of :id
|
@@ -248,7 +252,9 @@ module Osm
|
|
248
252
|
attribute :grouping_id, :type => Integer
|
249
253
|
attribute :fields, :default => {}
|
250
254
|
|
251
|
-
|
255
|
+
if ActiveModel::VERSION::MAJOR < 4
|
256
|
+
attr_accessible :flexi_record, :member_id, :grouping_id, :fields
|
257
|
+
end
|
252
258
|
|
253
259
|
validates_presence_of :flexi_record
|
254
260
|
validates_numericality_of :member_id, :only_integer=>true, :greater_than=>0
|
data/lib/osm/giftaid.rb
CHANGED
@@ -139,7 +139,9 @@ module Osm
|
|
139
139
|
|
140
140
|
attribute :donation_date, :type => Date
|
141
141
|
|
142
|
-
|
142
|
+
if ActiveModel::VERSION::MAJOR < 4
|
143
|
+
attr_accessible :note, :donation_date
|
144
|
+
end
|
143
145
|
|
144
146
|
validates_presence_of :donation_date
|
145
147
|
|
@@ -190,7 +192,9 @@ module Osm
|
|
190
192
|
attribute :total, :type => String
|
191
193
|
attribute :donations, :type => Object, :default => DirtyHashy.new
|
192
194
|
|
193
|
-
|
195
|
+
if ActiveModel::VERSION::MAJOR < 4
|
196
|
+
attr_accessible :member_id, :first_name, :last_name, :section_id, :grouping_id, :total, :tax_payer_name, :tax_payer_address, :tax_payer_postcode, :donations
|
197
|
+
end
|
194
198
|
|
195
199
|
validates_numericality_of :member_id, :only_integer=>true, :greater_than=>0
|
196
200
|
validates_numericality_of :grouping_id, :only_integer=>true, :greater_than_or_equal_to=>-2
|
data/lib/osm/grouping.rb
CHANGED
@@ -19,7 +19,9 @@ module Osm
|
|
19
19
|
attribute :active, :type => Boolean
|
20
20
|
attribute :points, :type => Integer
|
21
21
|
|
22
|
-
|
22
|
+
if ActiveModel::VERSION::MAJOR < 4
|
23
|
+
attr_accessible :id, :section_id, :name, :active, :points
|
24
|
+
end
|
23
25
|
|
24
26
|
validates_numericality_of :id, :only_integer=>true, :greater_than_or_equal_to=>-2
|
25
27
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
data/lib/osm/invoice.rb
CHANGED
@@ -24,7 +24,9 @@ module Osm
|
|
24
24
|
attribute :archived, :type => Boolean, :default => false
|
25
25
|
attribute :finalised, :type => Boolean, :default => false
|
26
26
|
|
27
|
-
|
27
|
+
if ActiveModel::VERSION::MAJOR < 4
|
28
|
+
attr_accessible :id, :section_id, :name, :extra_details, :date, :archived, :finalised
|
29
|
+
end
|
28
30
|
|
29
31
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :unless => Proc.new { |r| r.id.nil? }
|
30
32
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
@@ -293,7 +295,9 @@ module Osm
|
|
293
295
|
attribute :description, :type => String
|
294
296
|
attribute :budget_name, :type => String, :default => 'Default'
|
295
297
|
|
296
|
-
|
298
|
+
if ActiveModel::VERSION::MAJOR < 4
|
299
|
+
attr_accessible :id, :invoice, :record_id, :date, :amount, :type, :payto, :description, :budget_name
|
300
|
+
end
|
297
301
|
|
298
302
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :unless => Proc.new { |r| r.id.nil? }
|
299
303
|
validates_numericality_of :record_id, :only_integer=>true, :greater_than=>0, :unless => Proc.new { |r| r.record_id.nil? }
|
data/lib/osm/meeting.rb
CHANGED
@@ -45,7 +45,9 @@ module Osm
|
|
45
45
|
attribute :activities, :default => []
|
46
46
|
attribute :badge_links, :default => []
|
47
47
|
|
48
|
-
|
48
|
+
if ActiveModel::VERSION::MAJOR < 4
|
49
|
+
attr_accessible :id, :section_id, :title, :notes_for_parents, :games, :pre_notes, :post_notes, :leaders, :date, :activities, :start_time, :finish_time, :badge_links
|
50
|
+
end
|
49
51
|
|
50
52
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0
|
51
53
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
@@ -313,7 +315,7 @@ module Osm
|
|
313
315
|
|
314
316
|
private
|
315
317
|
class Activity
|
316
|
-
include ActiveModel::MassAssignmentSecurity
|
318
|
+
include ActiveModel::MassAssignmentSecurity if ActiveModel::VERSION::MAJOR < 4
|
317
319
|
include ActiveAttr::Model
|
318
320
|
|
319
321
|
# @!attribute [rw] activity_id
|
@@ -327,7 +329,9 @@ module Osm
|
|
327
329
|
attribute :title, :type => String
|
328
330
|
attribute :notes, :type => String, :default => ''
|
329
331
|
|
330
|
-
|
332
|
+
if ActiveModel::VERSION::MAJOR < 4
|
333
|
+
attr_accessible :activity_id, :title, :notes
|
334
|
+
end
|
331
335
|
|
332
336
|
validates_numericality_of :activity_id, :only_integer=>true, :greater_than=>0
|
333
337
|
validates_presence_of :title
|
@@ -347,7 +351,7 @@ module Osm
|
|
347
351
|
|
348
352
|
|
349
353
|
class BadgeLink
|
350
|
-
include ActiveModel::MassAssignmentSecurity
|
354
|
+
include ActiveModel::MassAssignmentSecurity if ActiveModel::VERSION::MAJOR < 4
|
351
355
|
include ActiveAttr::Model
|
352
356
|
|
353
357
|
# @!attribute [rw] badge_key
|
@@ -367,7 +371,9 @@ module Osm
|
|
367
371
|
attribute :badge_section, :type => Object
|
368
372
|
attribute :label, :type => String
|
369
373
|
|
370
|
-
|
374
|
+
if ActiveModel::VERSION::MAJOR < 4
|
375
|
+
attr_accessible :badge_key, :badge_type, :requirement_key, :badge_section, :label
|
376
|
+
end
|
371
377
|
|
372
378
|
validates_presence_of :badge_key
|
373
379
|
validates_format_of :requirement_key, :with => /\A[a-z]_\d{2}\Z/, :message => 'is not in the correct format (e.g. "a_01")'
|
data/lib/osm/member.rb
CHANGED
@@ -124,12 +124,14 @@ module Osm
|
|
124
124
|
attribute :joined_years, :type => Integer
|
125
125
|
attribute :has_photo, :type => Boolean, :default => false
|
126
126
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
127
|
+
if ActiveModel::VERSION::MAJOR < 4
|
128
|
+
attr_accessible :id, :section_id, :type, :first_name, :last_name, :email1, :email2, :email3, :email4,
|
129
|
+
:phone1, :phone2, :phone3, :phone4, :address, :address2, :date_of_birth, :started,
|
130
|
+
:joining_in_years, :parents, :notes, :medical, :religion, :school, :ethnicity, :subs,
|
131
|
+
:custom1, :custom2, :custom3, :custom4, :custom5, :custom6, :custom7, :custom8, :custom9,
|
132
|
+
:grouping_id, :grouping_leader, :joined, :age, :joined_years,
|
133
|
+
:has_photo
|
134
|
+
end
|
133
135
|
|
134
136
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :unless => Proc.new { |r| r.id.nil? }
|
135
137
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
data/lib/osm/model.rb
CHANGED
@@ -8,7 +8,7 @@ module Osm
|
|
8
8
|
# This class is expected to be inherited from.
|
9
9
|
# It provides the caching and permission handling for model objects.
|
10
10
|
class Model
|
11
|
-
include ActiveModel::MassAssignmentSecurity
|
11
|
+
include ActiveModel::MassAssignmentSecurity if ActiveModel::VERSION::MAJOR < 4
|
12
12
|
include ActiveAttr::Model
|
13
13
|
|
14
14
|
@@cache = nil # Class to use for caching
|
data/lib/osm/register.rb
CHANGED
@@ -145,7 +145,9 @@ module Osm
|
|
145
145
|
attribute :name, :type => String
|
146
146
|
attribute :tooltip, :type => String, :default => ''
|
147
147
|
|
148
|
-
|
148
|
+
if ActiveModel::VERSION::MAJOR < 4
|
149
|
+
attr_accessible :id, :name, :tooltip
|
150
|
+
end
|
149
151
|
|
150
152
|
validates_presence_of :id
|
151
153
|
validates_presence_of :name
|
@@ -189,7 +191,9 @@ module Osm
|
|
189
191
|
attribute :total, :type => Integer
|
190
192
|
attribute :attendance, :default => {}
|
191
193
|
|
192
|
-
|
194
|
+
if ActiveModel::VERSION::MAJOR < 4
|
195
|
+
attr_accessible :member_id, :first_name, :last_name, :section_id, :grouping_id, :total, :attendance
|
196
|
+
end
|
193
197
|
|
194
198
|
validates_numericality_of :member_id, :only_integer=>true, :greater_than=>0
|
195
199
|
validates_numericality_of :grouping_id, :only_integer=>true, :greater_than_or_equal_to=>-2
|
data/lib/osm/section.rb
CHANGED
@@ -114,17 +114,19 @@ module Osm
|
|
114
114
|
attribute :sms_messages_sent, :type => Integer, :default => 0
|
115
115
|
attribute :sms_messages_remaining, :type => Integer, :default => 0
|
116
116
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
117
|
+
if ActiveModel::VERSION::MAJOR < 4
|
118
|
+
attr_accessible :id, :name, :group_id, :group_name, :subscription_level, :subscription_expires,
|
119
|
+
:type, :column_names, :fields, :intouch_fields, :mobile_fields, :flexi_records,
|
120
|
+
:gocardless, :myscout_events_expires, :myscout_badges_expires,
|
121
|
+
:myscout_programme_expires, :myscout_details_expires, :myscout_events,
|
122
|
+
:myscout_badges, :myscout_programme, :myscout_payments, :myscout_details,
|
123
|
+
:myscout_emails, :myscout_email_address_from, :myscout_email_address_copy,
|
124
|
+
:myscout_badges_partial, :myscout_programme_summary, :myscout_programme_times,
|
125
|
+
:myscout_programme_show, :myscout_event_reminder_count,
|
126
|
+
:myscout_event_reminder_frequency, :myscout_payment_reminder_count,
|
127
|
+
:myscout_payment_reminder_frequency, :myscout_details_email_changes_to,
|
128
|
+
:sms_sent_test, :sms_messages_sent, :sms_messages_remaining
|
129
|
+
end
|
128
130
|
|
129
131
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :allow_nil => true
|
130
132
|
validates_numericality_of :group_id, :only_integer=>true, :greater_than=>0, :allow_nil => true
|
data/lib/osm/sms.rb
CHANGED
@@ -76,7 +76,9 @@ module Osm
|
|
76
76
|
attribute :credits, :type => Integer
|
77
77
|
attribute :status, :type => Object
|
78
78
|
|
79
|
-
|
79
|
+
if ActiveModel::VERSION::MAJOR < 4
|
80
|
+
attr_accessible :sms_id, :user_id, :member_id, :section_id, :from_name, :from_number, :to_name, :to_number, :message, :scheduled, :last_updated, :credits, :status
|
81
|
+
end
|
80
82
|
|
81
83
|
validates_numericality_of :sms_id, :only_integer=>true, :greater_than_or_equal_to=>0
|
82
84
|
validates_numericality_of :user_id, :only_integer=>true, :greater_than_or_equal_to=>0
|
data/lib/osm/term.rb
CHANGED
@@ -19,7 +19,9 @@ module Osm
|
|
19
19
|
attribute :start, :type => Date
|
20
20
|
attribute :finish, :type => Date
|
21
21
|
|
22
|
-
|
22
|
+
if ActiveModel::VERSION::MAJOR < 4
|
23
|
+
attr_accessible :id, :section_id, :name, :start, :finish
|
24
|
+
end
|
23
25
|
|
24
26
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0
|
25
27
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
data/osm.gemspec
CHANGED
@@ -19,16 +19,16 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_runtime_dependency 'activesupport', '
|
23
|
-
s.add_runtime_dependency 'httparty', '~> 0.9'
|
22
|
+
s.add_runtime_dependency 'activesupport', '>= 3.2', '< 5' # Used to parse JSON from OSM
|
23
|
+
s.add_runtime_dependency 'httparty', '~> 0.9' # Used to make web requests to the API
|
24
24
|
s.add_runtime_dependency 'active_attr', '~> 0.8'
|
25
|
-
s.add_runtime_dependency 'activemodel', '
|
26
|
-
s.add_runtime_dependency 'dirty_hashy', '~> 0.2.1'
|
25
|
+
s.add_runtime_dependency 'activemodel', '>= 3.2', '< 5'
|
26
|
+
s.add_runtime_dependency 'dirty_hashy', '~> 0.2.1' # Used to track changed data in Badge::Data and FlexiRecord::Data
|
27
27
|
|
28
28
|
s.add_development_dependency 'rake', '~> 10.0'
|
29
|
-
s.add_development_dependency 'rspec', '~> 2'
|
29
|
+
s.add_development_dependency 'rspec', '~> 2.0', '>= 2.14.1'
|
30
30
|
s.add_development_dependency 'fakeweb', '~> 1.3'
|
31
|
-
s.add_development_dependency 'guard-rspec', '~>
|
31
|
+
s.add_development_dependency 'guard-rspec', '~> 4.2', '>= 4.2.5'
|
32
32
|
s.add_development_dependency 'rb-inotify', '~> 0.9'
|
33
33
|
|
34
34
|
end
|
data/spec/osm/model_spec.rb
CHANGED
data/spec/osm/osm_spec.rb
CHANGED
@@ -61,12 +61,12 @@ describe "Online Scout Manager" do
|
|
61
61
|
class TestA < Osm::Model
|
62
62
|
attribute :id
|
63
63
|
attribute :b
|
64
|
-
attr_accessible :id, :b
|
64
|
+
attr_accessible :id, :b if ActiveModel::VERSION::MAJOR < 4
|
65
65
|
end
|
66
66
|
class TestB < Osm::Model
|
67
67
|
attribute :id
|
68
68
|
attribute :a
|
69
|
-
attr_accessible :id, :a
|
69
|
+
attr_accessible :id, :a if ActiveModel::VERSION::MAJOR < 4
|
70
70
|
end
|
71
71
|
|
72
72
|
it "Returns a string" do
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: osm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,30 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '3.2'
|
22
|
+
- - <
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '5'
|
22
25
|
type: :runtime
|
23
26
|
prerelease: false
|
24
27
|
version_requirements: !ruby/object:Gem::Requirement
|
25
28
|
none: false
|
26
29
|
requirements:
|
27
|
-
- -
|
30
|
+
- - ! '>='
|
28
31
|
- !ruby/object:Gem::Version
|
29
32
|
version: '3.2'
|
33
|
+
- - <
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '5'
|
30
36
|
- !ruby/object:Gem::Dependency
|
31
37
|
name: httparty
|
32
38
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,17 +70,23 @@ dependencies:
|
|
64
70
|
requirement: !ruby/object:Gem::Requirement
|
65
71
|
none: false
|
66
72
|
requirements:
|
67
|
-
- -
|
73
|
+
- - ! '>='
|
68
74
|
- !ruby/object:Gem::Version
|
69
75
|
version: '3.2'
|
76
|
+
- - <
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '5'
|
70
79
|
type: :runtime
|
71
80
|
prerelease: false
|
72
81
|
version_requirements: !ruby/object:Gem::Requirement
|
73
82
|
none: false
|
74
83
|
requirements:
|
75
|
-
- -
|
84
|
+
- - ! '>='
|
76
85
|
- !ruby/object:Gem::Version
|
77
86
|
version: '3.2'
|
87
|
+
- - <
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5'
|
78
90
|
- !ruby/object:Gem::Dependency
|
79
91
|
name: dirty_hashy
|
80
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +126,10 @@ dependencies:
|
|
114
126
|
requirements:
|
115
127
|
- - ~>
|
116
128
|
- !ruby/object:Gem::Version
|
117
|
-
version: '2'
|
129
|
+
version: '2.0'
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 2.14.1
|
118
133
|
type: :development
|
119
134
|
prerelease: false
|
120
135
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +137,10 @@ dependencies:
|
|
122
137
|
requirements:
|
123
138
|
- - ~>
|
124
139
|
- !ruby/object:Gem::Version
|
125
|
-
version: '2'
|
140
|
+
version: '2.0'
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: 2.14.1
|
126
144
|
- !ruby/object:Gem::Dependency
|
127
145
|
name: fakeweb
|
128
146
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,7 +164,10 @@ dependencies:
|
|
146
164
|
requirements:
|
147
165
|
- - ~>
|
148
166
|
- !ruby/object:Gem::Version
|
149
|
-
version: '
|
167
|
+
version: '4.2'
|
168
|
+
- - ! '>='
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: 4.2.5
|
150
171
|
type: :development
|
151
172
|
prerelease: false
|
152
173
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -154,7 +175,10 @@ dependencies:
|
|
154
175
|
requirements:
|
155
176
|
- - ~>
|
156
177
|
- !ruby/object:Gem::Version
|
157
|
-
version: '
|
178
|
+
version: '4.2'
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: 4.2.5
|
158
182
|
- !ruby/object:Gem::Dependency
|
159
183
|
name: rb-inotify
|
160
184
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,6 +212,7 @@ files:
|
|
188
212
|
- LICENSE.rdoc
|
189
213
|
- README.md
|
190
214
|
- Rakefile
|
215
|
+
- gemfiles/rails3
|
191
216
|
- lib/array_of_validator.rb
|
192
217
|
- lib/hash_validator.rb
|
193
218
|
- lib/osm.rb
|