Sha256: cb577a26e5b9bb67b14932118dc14e8a5255ae12e3a7f39fff5853b182b22296

Contents?: true

Size: 1.7 KB

Versions: 16

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        : <%= Faker::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 : <%= Faker::Lorem.paragraph[0,255] %>
<% end %>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 db/demo/opportunities.yml
fat_free_crm-0.13.5 db/demo/opportunities.yml
fat_free_crm-0.13.4 db/demo/opportunities.yml
fat_free_crm-0.13.3 db/demo/opportunities.yml
fat_free_crm-0.13.2 db/demo/opportunities.yml
fat_free_crm-0.12.3 db/demo/opportunities.yml
fat_free_crm-0.12.2 db/demo/opportunities.yml
fat_free_crm-0.13.1 db/demo/opportunities.yml
fat_free_crm-0.12.1 db/demo/opportunities.yml
fat_free_crm-0.13.0 db/demo/opportunities.yml
fat_free_crm-0.12.0 db/demo/opportunities.yml
fat_free_crm-0.11.4 db/demo/opportunities.yml
fat_free_crm-0.11.3 db/demo/opportunities.yml
fat_free_crm-0.11.2 db/demo/opportunities.yml
fat_free_crm-0.11.1 db/demo/opportunities.yml
fat_free_crm-0.11.0 db/demo/opportunities.yml