osm 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +8 -0
- data/lib/osm/model.rb +3 -2
- data/version.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
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 (#{
|
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