"123-456-789") ui.award_badge(current_user_email, "assistiu-palestra-caffo") ui.award_points(current_user_email, 10) # Mostra o widget de pontos points_widget = ui.get_widget(current_user_email, "points", 100, 100) puts points_widget # Mostra o widget de ranking rank_widget = ui.get_widget(current_user_email, "rank", 100, 100) puts rank_widget # Mostra o widget de badges (trophys no userinfuser) trophy_case_widget = ui.get_widget(current_user_email, "trophy_case") puts trophy_case_widget
Person include Mongoid::Document include Badgeable::Subject embeds_many :nachos end badge "Nacho Nacho Man" do thing Nacho count 40 subject :person conditions do |nacho| nacho.spicy? end end # Ou ainda jose = Person.create(:name => "Jose da Silva") jose.award_badge("Total Badass")