Skip to content

Instantly share code, notes, and snippets.

@tarolandia
Created October 16, 2013 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarolandia/7010093 to your computer and use it in GitHub Desktop.
Save tarolandia/7010093 to your computer and use it in GitHub Desktop.
class Measure
def valid?
true
end
end
Measure.extend(Spawn).spawner do |measure|
measure.source ||= ["profile","identity"].sample
measure.key ||= User::PROFILE_MEASURES.keys.sample.to_s
measure.type ||= measure.key
measure.unit ||= nil
measure.user ||= User.spawn
measure.description ||= Faker::Lorem.sentence(5)
measure.timestamp ||= DateTime.now.to_s
measure.value ||= User::PROFILE_MEASURES[measure.key.to_sym][:values].sample
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment