Skip to content

Upgrading 0.2.x to 0.3.x

Robert Gauld edited this page Feb 26, 2013 · 1 revision

Background

Initially you got the list of due badges by using the DueBadge class, whilst this was a quick fix to allow that feature in OSM Extender, it does not fit within a sensible hierachy of classes for accessing all the badge related features of OSM. In order to be nice about abreaking code which uses badges I;ve bumped the version number, If you do not use badges you shouldn't need to do anything to upgrade.

What you need to do

Getting Due Bades

# Was
Osm::DueBadges.get(api, section)

# Now
Osm::Badges.get_due_badges(api, section)

Getting Badge Stock

# Was
section = Osm::Section.get(api, id)
section.get_badge_stock(api)

# Now
Osm::badges.get_stock(api, section)