osm 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGELOG.md +8 -0
  2. data/lib/osm/model.rb +3 -2
  3. data/version.rb +1 -1
  4. metadata +1 -1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## Version 1.0.6
2
+
3
+ *
4
+
5
+ ## Version 1.0.5
6
+
7
+ * Fix undefined method youth_section? within Model.require\_ability\_to
8
+
1
9
  ## Version 1.0.4
2
10
 
3
11
  * Add notice board option to getting My.SCOUT link for a member (pass :notice as the parameter)
data/lib/osm/model.rb CHANGED
@@ -178,8 +178,8 @@ module Osm
178
178
  end
179
179
  end
180
180
  if section.nil? || section.subscription_level < level
181
- level_name = ['Unknown', 'Bronze', 'Silver', 'Gold'][level]
182
- raise Osm::Forbidden, "Insufficent OSM subscription level (#{level} required for #{section.name})"
181
+ level_name = ['Unknown', 'Bronze', 'Silver', 'Gold'][level] || level
182
+ raise Osm::Forbidden, "Insufficent OSM subscription level (#{level_name} required for #{section.name})"
183
183
  end
184
184
  end
185
185
 
@@ -190,6 +190,7 @@ module Osm
190
190
  # @param [Osm::Section, Fixnum, #to_i] section The Section (or its ID) the permission is required on
191
191
  # @!macro options_get
192
192
  def self.require_ability_to(api, to, on, section, options={})
193
+ section = Osm::Section.get(api, section, options) if section.is_a?(Fixnum)
193
194
  require_permission(api, to, on, section, options)
194
195
  if section.youth_section? && [:register, :contact, :events, :flexi].include?(on)
195
196
  require_subscription(api, :silver, section, options)
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
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.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: