Skip to content

Commit

Permalink
Demo:load fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Zlatko Zahariev committed Apr 19, 2013
1 parent 52b3554 commit 985f4f2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/users/fat_free_crm/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def check_if_current_user
# Prevent deleting a user unless she has no artifacts left.
#----------------------------------------------------------------------------
def check_if_has_related_assets
artifacts = [Account Campaign Lead Contact Opportunity Comment].inject(0) do |sum, asset|
artifacts = [FatFreeCrm::Account, FatFreeCrm::Campaign, FatFreeCrm::Lead, FatFreeCrm::Contact, FatFreeCrm::Opportunity, FatFreeCrm::Comment].inject(0) do |sum, asset|
klass = asset.constantize
sum += klass.assigned_to(self).count if asset != "Comment"
sum += klass.created_by(self).count
Expand Down
2 changes: 1 addition & 1 deletion db/demo/fat_free_crm_addresses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
puts "Loading addresses..."
type = %w(Billing Shipping)
addressable = %w(Account Contact Lead)
addressable = %w(FatFreeCrm::Account FatFreeCrm::Contact FatFreeCrm::Lead)
for i in (1 .. rand(200) + 200) do
%>
Expand Down
2 changes: 1 addition & 1 deletion db/demo/fat_free_crm_comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
require "ffaker"
puts "Loading comments..."
commentable = %w(Account Campaign Contact Lead Opportunity) # Task
commentable = %w(FatFreeCrm::Account FatFreeCrm::Campaign FatFreeCrm::Contact FatFreeCrm::Lead FatFreeCrm::Opportunity) # Task
for i in (1 .. rand(250) + 500) do
%>
comment_<%= i %>:
Expand Down
2 changes: 1 addition & 1 deletion db/demo/fat_free_crm_emails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
puts "Loading emails..."
users = %w(aaron bed cindy dan elizabeth frank george heather)
mediators = %w(Account Campaign Contact Lead Opportunity)
mediators = %w(FatFreeCrm::Account FatFreeCrm::Campaign FatFreeCrm::Contact FatFreeCrm::Lead FatFreeCrm::Opportunity)
for i in (1 .. rand(250) + 500) do
user = rand(users.size)
Expand Down

0 comments on commit 985f4f2

Please sign in to comment.