Sha256: a294694324a1d597180647f5d209e7f6e544aff171cc2ea7a2ca2a0036c73f96
Contents?: true
Size: 1.7 KB
Versions: 28
Compression:
Stored size: 1.7 KB
Contents
# == Schema Information # # Table name: opportunities # # id :integer not null, primary key # user_id :integer # campaign_id :integer # assigned_to :integer # name :string(64) default(""), not null # access :string(8) default("Public") # source :string(32) # stage :string(32) # probability :integer # amount :decimal(12, 2) # discount :decimal(12, 2) # closes_on :date # deleted_at :datetime # created_at :datetime # updated_at :datetime # background_info :string(255) # <% require "ffaker" puts "Loading opportunities..." source = %w(campaign cold_call conference online referral self web word_of_mouth other) << "" stage = %w(prospecting analysis presentation proposal negotiation final_review won lost) << "" for i in (1 .. rand(20) + 100) do %> opportunity_<%= i %>: id : <%= i %> user_id : <%= rand(8) + 1 %> campaign_id : <%= (rand(5) + 1) if i > 10 %> assigned_to : <%= rand(8) + 1 %> name : <%= FFaker::Lorem::sentence(rand(2) + 2).sub(".", "")[0, 64] %> # name has a limit of 64 characters. access : Public source : <%= source.sample %> stage : <%= the_stage = stage.sample %> probability : <%= %w(won lost).include?(the_stage) ? 100 : (rand(8) + 1) * 10 %> amount : <%= (rand(8) + 1) * 100_000 %> closes_on : <%= Date.today + (rand(100) + 10).days %> background_info : created_at : <%= created_at = (rand(60) + 2).days.ago + rand(600).minutes; created_at.to_s(:db) %> updated_at : <%= (created_at + rand(36_000).seconds).to_s(:db) %> background_info : <%= FFaker::Lorem.paragraph[0,255] %> <% end %>
Version data entries
28 entries across 28 versions & 2 rubygems