seedy 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/seedy/generators/user.rb +1 -1
- data/lib/seedy/graphs/abstract_graph.rb +2 -2
- data/lib/seedy/graphs/simple_graph.rb +2 -2
- data/lib/seedy/records/users.rb +8 -6
- data/seedy.gemspec +1 -3
- data/test/test_seedy.rb +1 -1
- metadata +3 -5
- data/lib/seedy/graphs/instance_methods.rb +0 -0
- data/lib/seedy/graphs/user_graph.rb +0 -35
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.6
|
@@ -16,8 +16,8 @@ class SimpleGraph < AbstractGraph
|
|
16
16
|
@@buffer = Seedy::DatabaseBuffer
|
17
17
|
|
18
18
|
# Creates a new user record, and all the dependent records listed above
|
19
|
-
def initialize()
|
20
|
-
create_user
|
19
|
+
def initialize(offset=nil)
|
20
|
+
create_user(offset)
|
21
21
|
create_teams
|
22
22
|
create_accounts
|
23
23
|
create_bugs
|
data/lib/seedy/records/users.rb
CHANGED
@@ -26,19 +26,21 @@ module Seedy
|
|
26
26
|
}
|
27
27
|
|
28
28
|
class << self
|
29
|
-
def build
|
29
|
+
def build(offset)
|
30
30
|
user = Users.new
|
31
|
-
user.update_attributes
|
31
|
+
user.update_attributes(offset)
|
32
32
|
user
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
def update_attributes
|
37
|
-
write_attribute(:user_name, set_user_name)
|
38
|
-
write_attribute(:sugar_login,
|
36
|
+
def update_attributes(offset)
|
37
|
+
write_attribute(:user_name, set_user_name(offset))
|
38
|
+
write_attribute(:sugar_login, 0)
|
39
|
+
write_attribute(:user_hash, OpenSSL::Digest::MD5.new("#{offset}")) if offset
|
39
40
|
end
|
40
41
|
|
41
|
-
def set_user_name
|
42
|
+
def set_user_name(offset)
|
43
|
+
return "user#{offset}" if offset
|
42
44
|
(@attributes[:first_name][0,1] + @attributes[:last_name][0,6]).downcase
|
43
45
|
end
|
44
46
|
end
|
data/seedy.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{seedy}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Carl Hicks"]
|
@@ -54,9 +54,7 @@ Gem::Specification.new do |s|
|
|
54
54
|
"lib/seedy/generators/website.rb",
|
55
55
|
"lib/seedy/graph.rb",
|
56
56
|
"lib/seedy/graphs/abstract_graph.rb",
|
57
|
-
"lib/seedy/graphs/instance_methods.rb",
|
58
57
|
"lib/seedy/graphs/simple_graph.rb",
|
59
|
-
"lib/seedy/graphs/user_graph.rb",
|
60
58
|
"lib/seedy/random.rb",
|
61
59
|
"lib/seedy/record.rb",
|
62
60
|
"lib/seedy/records/accounts.rb",
|
data/test/test_seedy.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seedy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 6
|
10
|
+
version: 0.6.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Carl Hicks
|
@@ -253,9 +253,7 @@ files:
|
|
253
253
|
- lib/seedy/generators/website.rb
|
254
254
|
- lib/seedy/graph.rb
|
255
255
|
- lib/seedy/graphs/abstract_graph.rb
|
256
|
-
- lib/seedy/graphs/instance_methods.rb
|
257
256
|
- lib/seedy/graphs/simple_graph.rb
|
258
|
-
- lib/seedy/graphs/user_graph.rb
|
259
257
|
- lib/seedy/random.rb
|
260
258
|
- lib/seedy/record.rb
|
261
259
|
- lib/seedy/records/accounts.rb
|
File without changes
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Seedy
|
2
|
-
class UserGraph < AbstractGraph
|
3
|
-
@@related_records = {
|
4
|
-
'Teams' => 1,
|
5
|
-
'Accounts' => 20,
|
6
|
-
'Bugs' => 60,
|
7
|
-
'Calls' => 480,
|
8
|
-
'Cases' => 80,
|
9
|
-
'Contacts' => 80,
|
10
|
-
'Documents'=> 80,
|
11
|
-
'Emails' => 320,
|
12
|
-
'EmailAddresses'=> 80,
|
13
|
-
'Leads' => 80,
|
14
|
-
'Meetings' => 160,
|
15
|
-
'Notes' => 80,
|
16
|
-
'Opportunities' => 40,
|
17
|
-
'Products' => 80,
|
18
|
-
'ProductBundles' => 40,
|
19
|
-
'Quotes' => 20,
|
20
|
-
'Tasks' => 80,
|
21
|
-
}
|
22
|
-
|
23
|
-
# Creates a new user record, and all the dependent records listed above
|
24
|
-
def initialize
|
25
|
-
user = Users.build
|
26
|
-
@@related_records.each_pair do |module_name,count|
|
27
|
-
count.times {
|
28
|
-
record = module_name.build(self)
|
29
|
-
DatabaseBuffer.insert(record)
|
30
|
-
}
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|