You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
639 B

# Fakes live gameplay so the banner developer has moving numbers to build
# against. Called on each leaderboard cache refresh (~once a minute); each call
# adds a handful of random players across random countries, most of them done.
#
# TEMPORARY: set ENABLED = false (or delete this) and wipe the players table
# before the game goes live.
class DemoActivity
ENABLED = false
def self.simulate!
return unless ENABLED
countries = I18n.t("countries").keys.map(&:to_s)
rand(5..20).times do
Player.create!(
locale: "en",
country: countries.sample,
is_done: rand < 0.7
)
end
end
end