fat_free_crm 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- data/.gitignore +1 -0
- data/.travis.yml +2 -2
- data/Gemfile +15 -2
- data/Gemfile.lock +34 -14
- data/README.md +37 -124
- data/app/assets/javascripts/application.js.erb +1 -1
- data/app/assets/javascripts/crm.js +22 -1
- data/app/assets/javascripts/crm_fields.js +2 -3
- data/app/assets/javascripts/jquery-noconflict.js +17 -0
- data/app/assets/stylesheets/application.css.erb +1 -0
- data/app/assets/stylesheets/common.scss +26 -0
- data/app/assets/stylesheets/ffcrm_chosen.scss +1 -1
- data/app/controllers/admin/application_controller.rb +1 -1
- data/app/controllers/application_controller.rb +0 -8
- data/app/controllers/{accounts_controller.rb → entities/accounts_controller.rb} +1 -13
- data/app/controllers/{campaigns_controller.rb → entities/campaigns_controller.rb} +1 -13
- data/app/controllers/{contacts_controller.rb → entities/contacts_controller.rb} +1 -7
- data/app/controllers/{leads_controller.rb → entities/leads_controller.rb} +1 -1
- data/app/controllers/{opportunities_controller.rb → entities/opportunities_controller.rb} +1 -7
- data/app/controllers/{tasks_controller.rb → entities/tasks_controller.rb} +1 -1
- data/app/controllers/{base_controller.rb → entities_controller.rb} +32 -1
- data/app/controllers/home_controller.rb +9 -9
- data/app/controllers/lists_controller.rb +17 -0
- data/app/helpers/admin/tags_helper.rb +1 -1
- data/app/helpers/application_helper.rb +14 -14
- data/app/helpers/crm_tags_helper.rb +1 -1
- data/app/helpers/home_helper.rb +13 -15
- data/app/helpers/lists_helper.rb +17 -0
- data/app/inputs/date_time_input.rb +17 -0
- data/app/inputs/text_input.rb +17 -1
- data/app/models/{base → entities}/account.rb +0 -1
- data/app/models/{base → entities}/account_contact.rb +0 -0
- data/app/models/{base → entities}/account_opportunity.rb +0 -0
- data/app/models/{base → entities}/campaign.rb +0 -1
- data/app/models/{base → entities}/contact.rb +0 -1
- data/app/models/{base → entities}/contact_opportunity.rb +0 -0
- data/app/models/{base → entities}/lead.rb +0 -1
- data/app/models/{base → entities}/opportunity.rb +0 -1
- data/app/models/{base → entities}/task.rb +5 -6
- data/app/models/list.rb +17 -0
- data/app/models/observers/lead_observer.rb +39 -0
- data/app/models/observers/opportunity_observer.rb +54 -0
- data/app/models/observers/task_observer.rb +41 -0
- data/app/models/polymorphic/address.rb +1 -3
- data/app/models/polymorphic/avatar.rb +0 -5
- data/app/models/polymorphic/comment.rb +2 -11
- data/app/models/polymorphic/email.rb +2 -9
- data/app/models/polymorphic/tag.rb +17 -0
- data/app/models/polymorphic/tagging.rb +17 -0
- data/app/models/users/ability.rb +13 -0
- data/app/models/users/user.rb +1 -4
- data/app/views/accounts/_account.html.haml +10 -6
- data/app/views/accounts/index.html.haml +1 -1
- data/app/views/accounts/show.html.haml +6 -24
- data/app/views/admin/fields/_field.html.haml +6 -6
- data/app/views/admin/tags/_tag.html.haml +2 -2
- data/app/views/admin/tags/index.html.haml +1 -1
- data/app/views/admin/users/_user.html.haml +3 -3
- data/app/views/admin/users/index.html.haml +1 -1
- data/app/views/campaigns/_campaign.html.haml +9 -5
- data/app/views/campaigns/index.html.haml +1 -1
- data/app/views/campaigns/show.html.haml +4 -24
- data/app/views/comments/_comment.html.haml +17 -14
- data/app/views/comments/_edit.html.haml +1 -1
- data/app/views/comments/_new.html.haml +3 -3
- data/app/views/contacts/_contact.html.haml +33 -15
- data/app/views/contacts/_contacts.html.haml +6 -0
- data/app/views/contacts/_sidebar_show.html.haml +1 -1
- data/app/views/contacts/index.html.haml +1 -1
- data/app/views/contacts/show.html.haml +3 -19
- data/app/views/emails/_email.html.haml +24 -21
- data/app/views/{base → entities}/_advanced_search.html.haml +0 -0
- data/app/views/{base → entities}/_condition_fields.html.haml +0 -0
- data/app/views/{base → entities}/_grouping_fields.html.haml +0 -0
- data/app/views/{base → entities}/_sort_fields.html.haml +0 -0
- data/app/views/{base → entities}/advanced_search.js.rjs +0 -0
- data/app/views/entities/contacts.js.rjs +3 -0
- data/app/views/entities/leads.js.rjs +3 -0
- data/app/views/entities/opportunities.js.rjs +3 -0
- data/app/views/entities/versions.js.rjs +3 -0
- data/app/views/home/_activity.html.haml +19 -18
- data/app/views/home/_events_menu.html.haml +8 -0
- data/app/views/home/_options.html.haml +2 -3
- data/app/views/home/index.html.haml +1 -1
- data/app/views/leads/_lead.html.haml +42 -23
- data/app/views/leads/_leads.html.haml +6 -0
- data/app/views/leads/_sidebar_show.html.haml +1 -1
- data/app/views/leads/index.html.haml +1 -1
- data/app/views/leads/show.html.haml +3 -13
- data/app/views/opportunities/_opportunities.html.haml +6 -0
- data/app/views/opportunities/_opportunity.html.haml +23 -11
- data/app/views/opportunities/index.html.haml +1 -1
- data/app/views/opportunities/show.html.haml +4 -18
- data/app/views/shared/_comment.html.haml +3 -3
- data/app/views/shared/_edit_comment.html.haml +1 -1
- data/app/views/shared/_recent.html.haml +4 -4
- data/app/views/shared/_recently.html.haml +3 -3
- data/app/views/shared/_timeline.html.haml +2 -3
- data/app/views/tasks/_assigned.html.haml +4 -4
- data/app/views/tasks/_completed.html.haml +2 -2
- data/app/views/tasks/_pending.html.haml +2 -2
- data/app/views/tasks/_related.html.haml +4 -5
- data/app/views/tasks/_tasks.html.haml +3 -0
- data/app/views/tasks/_title.html.haml +1 -1
- data/app/views/tasks/index.html.haml +1 -1
- data/app/views/users/_avatar.html.haml +2 -2
- data/app/views/versions/_version.html.haml +9 -12
- data/app/views/versions/_versions.html.haml +11 -0
- data/config/application.rb +3 -2
- data/config/environments/development.rb +2 -2
- data/config/environments/production.rb +0 -4
- data/config/environments/staging.rb +1 -1
- data/config/initializers/action_mailer.rb +9 -0
- data/config/initializers/paper_trail.rb +80 -0
- data/config/initializers/relative_url_root.rb +23 -0
- data/config/locales/cz_fat_free_crm.yml +1 -1
- data/config/locales/en-US_fat_free_crm.yml +22 -17
- data/config/locales/fr_fat_free_crm.yml +349 -134
- data/config/routes.rb +144 -140
- data/config/settings.default.yml +14 -2
- data/db/demo/addresses.yml +2 -2
- data/db/demo/emails.yml +2 -2
- data/db/migrate/20120216042541_is_paranoid_to_paper_trail.rb +1 -2
- data/db/migrate/20120309070209_add_versions_related.rb +6 -0
- data/db/migrate/20120316045804_activities_to_versions.rb +35 -0
- data/db/schema.rb +79 -53
- data/fat_free_crm.gemspec +8 -4
- data/lib/development_tasks/gem.rake +18 -1
- data/lib/development_tasks/license.rake +2 -4
- data/lib/development_tasks/rdoc.rake +17 -0
- data/lib/development_tasks/rspec.rake +17 -0
- data/lib/fat_free_crm.rb +20 -14
- data/lib/fat_free_crm/core_ext/array.rb +0 -27
- data/lib/fat_free_crm/dropbox.rb +11 -1
- data/lib/fat_free_crm/engine.rb +21 -3
- data/lib/fat_free_crm/gem_dependencies.rb +26 -0
- data/lib/fat_free_crm/gem_ext.rb +18 -1
- data/lib/fat_free_crm/gem_ext/active_record/schema_dumper.rb +18 -1
- data/lib/fat_free_crm/gem_ext/authlogic/session/cookies.rb +17 -0
- data/lib/fat_free_crm/gem_ext/rails/engine.rb +17 -0
- data/lib/fat_free_crm/gem_ext/rails/text_helper.rb +17 -0
- data/lib/fat_free_crm/gem_ext/rake/task.rb +17 -0
- data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +18 -1
- data/lib/fat_free_crm/plugin_dependencies.rb +23 -5
- data/lib/fat_free_crm/renderers.rb +17 -0
- data/lib/fat_free_crm/syck_yaml.rb +17 -0
- data/lib/fat_free_crm/version.rb +1 -1
- data/lib/{country_select → plugins/country_select}/MIT-LICENSE +0 -0
- data/lib/{country_select → plugins/country_select}/README +0 -0
- data/lib/{country_select → plugins/country_select}/init.rb +0 -0
- data/lib/{country_select → plugins/country_select}/install.rb +0 -0
- data/lib/{country_select → plugins/country_select}/lib/country_select.rb +0 -0
- data/lib/{country_select → plugins/country_select}/uninstall.rb +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/Gemfile +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/README.textile +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/ROADMAP.textile +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/Rakefile +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/VERSION +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/gravatar_image_tag.gemspec +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/init.rb +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/lib/gravatar_image_tag.rb +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/spec/gravatar_image_tag_spec.rb +0 -0
- data/lib/{gravatar_image_tag → plugins/gravatar_image_tag}/spec/test_helper.rb +0 -0
- data/lib/tasks/demo.rake +32 -29
- data/lib/tasks/dropbox.rake +1 -1
- data/lib/tasks/fat_free_crm.rake +3 -2
- data/lib/tasks/plugins.rake +1 -0
- data/spec/controllers/accounts_controller_spec.rb +7 -5
- data/spec/controllers/campaigns_controller_spec.rb +11 -9
- data/spec/controllers/contacts_controller_spec.rb +7 -5
- data/spec/controllers/home_controller_spec.rb +2 -2
- data/spec/controllers/leads_controller_spec.rb +7 -5
- data/spec/controllers/opportunities_controller_spec.rb +7 -5
- data/spec/factories/shared_factories.rb +8 -11
- data/spec/lib/dropbox_spec.rb +1 -0
- data/spec/models/polymorphic/version_spec.rb +247 -0
- data/spec/models/users/user_spec.rb +0 -9
- data/spec/spec_helper.rb +4 -0
- data/spec/views/home/index.haml_spec.rb +1 -1
- data/spec/views/home/index.rjs_spec.rb +4 -4
- data/spec/views/tasks/new.rjs_spec.rb +2 -2
- data/vendor/assets/javascripts/calendar_date_select/format_french.js +24 -0
- metadata +167 -126
- data/app/models/observers/activity_observer.rb +0 -84
- data/app/models/polymorphic/activity.rb +0 -106
- data/app/views/accounts/contacts.js.rjs +0 -3
- data/app/views/accounts/opportunities.js.rjs +0 -3
- data/app/views/campaigns/leads.js.rjs +0 -3
- data/app/views/campaigns/opportunities.js.rjs +0 -3
- data/app/views/contacts/opportunities.js.rjs +0 -3
- data/app/views/home/_actions_menu.html.haml +0 -8
- data/lib/dynamic_form/MIT-LICENSE +0 -20
- data/lib/dynamic_form/README +0 -13
- data/lib/dynamic_form/Rakefile +0 -10
- data/lib/dynamic_form/dynamic_form.gemspec +0 -12
- data/lib/dynamic_form/init.rb +0 -2
- data/lib/dynamic_form/lib/action_view/helpers/dynamic_form.rb +0 -301
- data/lib/dynamic_form/lib/action_view/locale/en-US.yml +0 -8
- data/lib/dynamic_form/lib/dynamic_form.rb +0 -6
- data/lib/dynamic_form/test/dynamic_form_i18n_test.rb +0 -42
- data/lib/dynamic_form/test/dynamic_form_test.rb +0 -370
- data/lib/dynamic_form/test/test_helper.rb +0 -10
- data/lib/responds_to_parent/MIT-LICENSE +0 -20
- data/lib/responds_to_parent/README +0 -47
- data/lib/responds_to_parent/Rakefile +0 -22
- data/lib/responds_to_parent/init.rb +0 -2
- data/lib/responds_to_parent/install.rb +0 -2
- data/lib/responds_to_parent/lib/responds_to_parent.rb +0 -70
- data/lib/responds_to_parent/test/responds_to_parent_test.rb +0 -11
- data/lib/responds_to_parent/test/test_helper.rb +0 -7
- data/lib/responds_to_parent/uninstall.rb +0 -2
- data/spec/models/polymorphic/activity_spec.rb +0 -303
data/config/routes.rb
CHANGED
@@ -1,172 +1,176 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
member do
|
34
|
-
put :attach
|
35
|
-
post :discard
|
36
|
-
get :contacts
|
37
|
-
get :opportunities
|
38
|
-
end
|
2
|
+
resources :lists
|
3
|
+
|
4
|
+
root :to => 'home#index'
|
5
|
+
|
6
|
+
match 'activities' => 'home#index'
|
7
|
+
match 'admin' => 'admin/users#index', :as => :admin
|
8
|
+
match 'login' => 'authentications#new', :as => :login
|
9
|
+
match 'logout' => 'authentications#destroy', :as => :logout
|
10
|
+
match 'profile' => 'users#show', :as => :profile
|
11
|
+
match 'signup' => 'users#new', :as => :signup
|
12
|
+
|
13
|
+
match '/home/options', :as => :options
|
14
|
+
match '/home/toggle', :as => :toggle
|
15
|
+
match '/home/timeline', :as => :timeline
|
16
|
+
match '/home/timezone', :as => :timezone
|
17
|
+
match '/home/redraw', :as => :redraw
|
18
|
+
|
19
|
+
resource :authentication
|
20
|
+
resources :comments
|
21
|
+
resources :emails
|
22
|
+
resources :passwords
|
23
|
+
|
24
|
+
resources :accounts, :id => /\d+/ do
|
25
|
+
collection do
|
26
|
+
get :advanced_search
|
27
|
+
post :filter
|
28
|
+
get :options
|
29
|
+
get :field_group
|
30
|
+
match :auto_complete
|
31
|
+
post :redraw
|
32
|
+
get :versions
|
39
33
|
end
|
34
|
+
member do
|
35
|
+
put :attach
|
36
|
+
post :discard
|
37
|
+
get :contacts
|
38
|
+
get :opportunities
|
39
|
+
end
|
40
|
+
end
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
42
|
+
resources :campaigns, :id => /\d+/ do
|
43
|
+
collection do
|
44
|
+
get :advanced_search
|
45
|
+
post :filter
|
46
|
+
get :options
|
47
|
+
get :field_group
|
48
|
+
post :auto_complete
|
49
|
+
post :redraw
|
50
|
+
get :versions
|
51
|
+
end
|
52
|
+
member do
|
53
|
+
put :attach
|
54
|
+
post :discard
|
55
|
+
get :leads
|
56
|
+
get :opportunities
|
56
57
|
end
|
58
|
+
end
|
57
59
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
60
|
+
resources :contacts, :id => /\d+/ do
|
61
|
+
collection do
|
62
|
+
get :advanced_search
|
63
|
+
post :filter
|
64
|
+
get :options
|
65
|
+
get :field_group
|
66
|
+
post :auto_complete
|
67
|
+
post :redraw
|
68
|
+
get :versions
|
69
|
+
end
|
70
|
+
member do
|
71
|
+
put :attach
|
72
|
+
post :discard
|
73
|
+
get :opportunities
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
resources :leads, :id => /\d+/ do
|
78
|
+
collection do
|
79
|
+
get :advanced_search
|
80
|
+
post :filter
|
81
|
+
get :options
|
82
|
+
get :field_group
|
83
|
+
post :auto_complete
|
84
|
+
post :redraw
|
85
|
+
get :versions
|
86
|
+
end
|
87
|
+
member do
|
88
|
+
get :convert
|
89
|
+
post :discard
|
90
|
+
put :attach
|
91
|
+
put :promote
|
92
|
+
put :reject
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
resources :opportunities, :id => /\d+/ do
|
97
|
+
collection do
|
98
|
+
get :advanced_search
|
99
|
+
post :filter
|
100
|
+
get :options
|
101
|
+
get :field_group
|
102
|
+
post :auto_complete
|
103
|
+
post :redraw
|
104
|
+
get :versions
|
105
|
+
end
|
106
|
+
member do
|
107
|
+
put :attach
|
108
|
+
post :discard
|
109
|
+
get :contacts
|
72
110
|
end
|
111
|
+
end
|
73
112
|
|
74
|
-
|
113
|
+
resources :tasks, :id => /\d+/ do
|
114
|
+
collection do
|
115
|
+
post :filter
|
116
|
+
post :auto_complete
|
117
|
+
end
|
118
|
+
member do
|
119
|
+
put :complete
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
resources :users, :id => /\d+/ do
|
124
|
+
member do
|
125
|
+
get :avatar
|
126
|
+
get :password
|
127
|
+
put :upload_avatar
|
128
|
+
put :change_password
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
namespace :admin do
|
133
|
+
resources :users do
|
75
134
|
collection do
|
76
|
-
get :advanced_search
|
77
|
-
post :filter
|
78
|
-
get :options
|
79
|
-
get :field_group
|
80
135
|
post :auto_complete
|
81
|
-
post :redraw
|
82
136
|
end
|
83
137
|
member do
|
84
|
-
get
|
85
|
-
|
86
|
-
put
|
87
|
-
put :promote
|
88
|
-
put :reject
|
138
|
+
get :confirm
|
139
|
+
put :suspend
|
140
|
+
put :reactivate
|
89
141
|
end
|
90
142
|
end
|
91
143
|
|
92
|
-
resources :
|
144
|
+
resources :field_groups, :except => :index do
|
93
145
|
collection do
|
94
|
-
|
95
|
-
post :filter
|
96
|
-
get :options
|
97
|
-
get :field_group
|
98
|
-
post :auto_complete
|
99
|
-
post :redraw
|
146
|
+
post :sort
|
100
147
|
end
|
101
148
|
member do
|
102
|
-
|
103
|
-
post :discard
|
104
|
-
get :contacts
|
149
|
+
get :confirm
|
105
150
|
end
|
106
151
|
end
|
107
152
|
|
108
|
-
resources :
|
153
|
+
resources :fields do
|
109
154
|
collection do
|
110
|
-
post :filter
|
111
155
|
post :auto_complete
|
112
|
-
|
113
|
-
|
114
|
-
|
156
|
+
get :options
|
157
|
+
post :redraw
|
158
|
+
post :sort
|
115
159
|
end
|
116
160
|
end
|
117
161
|
|
118
|
-
resources :
|
162
|
+
resources :tags do
|
119
163
|
member do
|
120
|
-
get :
|
121
|
-
get :password
|
122
|
-
put :upload_avatar
|
123
|
-
put :change_password
|
164
|
+
get :confirm
|
124
165
|
end
|
125
166
|
end
|
126
167
|
|
127
|
-
|
128
|
-
|
129
|
-
collection do
|
130
|
-
post :auto_complete
|
131
|
-
end
|
132
|
-
member do
|
133
|
-
get :confirm
|
134
|
-
put :suspend
|
135
|
-
put :reactivate
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
resources :field_groups, :except => :index do
|
140
|
-
collection do
|
141
|
-
post :sort
|
142
|
-
end
|
143
|
-
member do
|
144
|
-
get :confirm
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
resources :fields do
|
149
|
-
collection do
|
150
|
-
post :auto_complete
|
151
|
-
get :options
|
152
|
-
post :redraw
|
153
|
-
post :sort
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
resources :tags do
|
158
|
-
member do
|
159
|
-
get :confirm
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
resources :fields, :as => :custom_fields
|
164
|
-
resources :fields, :as => :core_fields
|
168
|
+
resources :fields, :as => :custom_fields
|
169
|
+
resources :fields, :as => :core_fields
|
165
170
|
|
166
|
-
|
167
|
-
|
168
|
-
end
|
169
|
-
|
170
|
-
get '/:controller/tagged/:id' => '#tagged'
|
171
|
+
resources :settings
|
172
|
+
resources :plugins
|
171
173
|
end
|
174
|
+
|
175
|
+
get '/:controller/tagged/:id' => '#tagged'
|
172
176
|
end
|
data/config/settings.default.yml
CHANGED
@@ -73,8 +73,20 @@
|
|
73
73
|
:locale: "en-US"
|
74
74
|
|
75
75
|
|
76
|
-
# Settings for
|
77
|
-
# -
|
76
|
+
# Settings for outgoing email (SMTP)
|
77
|
+
# - Default configuration is for GMail
|
78
|
+
#------------------------------------------------------------------------------
|
79
|
+
:smtp:
|
80
|
+
:address : "smtp.gmail.com"
|
81
|
+
:enable_starttls_auto : true
|
82
|
+
:port : 587
|
83
|
+
:authentication : :plain
|
84
|
+
:user_name : ""
|
85
|
+
:password : ""
|
86
|
+
|
87
|
+
|
88
|
+
# Settings for the Email dropbox (IMAP)
|
89
|
+
# - Connection settings for the IMAP account, server and folders.
|
78
90
|
#------------------------------------------------------------------------------
|
79
91
|
:email_dropbox:
|
80
92
|
:server : "" # IMAP server name.
|
data/db/demo/addresses.yml
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
# deleted_at :datetime
|
19
19
|
#
|
20
20
|
|
21
|
-
<%
|
21
|
+
<%
|
22
22
|
require "ffaker"
|
23
23
|
puts "Loading addresses..."
|
24
24
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
%>
|
30
30
|
address_<%= i %>:
|
31
31
|
id : <%= i %>
|
32
|
-
addressable_id : <%= i %>
|
32
|
+
addressable_id : <%= i/2 %>
|
33
33
|
addressable_type : <%= asset = addressable.sample %>
|
34
34
|
address_type : <%= asset == 'Account' ? type.sample : 'Business' %>
|
35
35
|
street1 : <%= street1 = Faker::Address.street_address %>
|
data/db/demo/emails.yml
CHANGED
@@ -2,8 +2,7 @@ class IsParanoidToPaperTrail < ActiveRecord::Migration
|
|
2
2
|
def up
|
3
3
|
[Account, Campaign, Contact, Lead, Opportunity, Task].each do |klass|
|
4
4
|
klass.where('deleted_at IS NOT NULL').each do |object|
|
5
|
-
object.destroy
|
6
|
-
Activity.last.destroy # Remove the destroy activity because we should already have one indicating this object is destroyed
|
5
|
+
object.destroy
|
7
6
|
end
|
8
7
|
end
|
9
8
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class ActivitiesToVersions < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
events = {
|
4
|
+
'created' => 'create',
|
5
|
+
'viewed' => 'view',
|
6
|
+
'updated' => 'update',
|
7
|
+
'deleted' => 'destroy',
|
8
|
+
'rejected' => 'reject',
|
9
|
+
'won' => 'won',
|
10
|
+
'completed' => 'complete',
|
11
|
+
'reassigned' => 'reassign',
|
12
|
+
'rescheduled' => 'reschedule'
|
13
|
+
}
|
14
|
+
|
15
|
+
activities = connection.select_all 'SELECT * FROM activities'
|
16
|
+
activities.each do |activity|
|
17
|
+
# commented and email activities don't translate well so ignore them
|
18
|
+
if event = events[activity['action']]
|
19
|
+
attributes = {
|
20
|
+
:item_id => activity['subject_id'],
|
21
|
+
:item_type => activity['subject_type'],
|
22
|
+
:whodunnit => activity['user_id'],
|
23
|
+
:event => event,
|
24
|
+
:created_at => activity['created_at']
|
25
|
+
}
|
26
|
+
version = Version.new
|
27
|
+
attributes.each {|k, v| version.send("#{k}=", v)}
|
28
|
+
version.save!
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def down
|
34
|
+
end
|
35
|
+
end
|
data/db/schema.rb
CHANGED
@@ -11,39 +11,46 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20120316045804) do
|
15
|
+
|
16
|
+
create_table "account_aliases", :force => true do |t|
|
17
|
+
t.integer "account_id"
|
18
|
+
t.integer "destroyed_account_id"
|
19
|
+
t.datetime "created_at"
|
20
|
+
t.datetime "updated_at"
|
21
|
+
end
|
15
22
|
|
16
23
|
create_table "account_contacts", :force => true do |t|
|
17
24
|
t.integer "account_id"
|
18
25
|
t.integer "contact_id"
|
19
26
|
t.datetime "deleted_at"
|
20
|
-
t.datetime "created_at"
|
21
|
-
t.datetime "updated_at"
|
27
|
+
t.datetime "created_at"
|
28
|
+
t.datetime "updated_at"
|
22
29
|
end
|
23
30
|
|
24
31
|
create_table "account_opportunities", :force => true do |t|
|
25
32
|
t.integer "account_id"
|
26
33
|
t.integer "opportunity_id"
|
27
34
|
t.datetime "deleted_at"
|
28
|
-
t.datetime "created_at"
|
29
|
-
t.datetime "updated_at"
|
35
|
+
t.datetime "created_at"
|
36
|
+
t.datetime "updated_at"
|
30
37
|
end
|
31
38
|
|
32
39
|
create_table "accounts", :force => true do |t|
|
33
40
|
t.integer "user_id"
|
34
41
|
t.integer "assigned_to"
|
35
|
-
t.string "name", :limit =>
|
36
|
-
t.string "access", :limit => 8,
|
42
|
+
t.string "name", :limit => 128, :default => "", :null => false
|
43
|
+
t.string "access", :limit => 8, :default => "Public"
|
37
44
|
t.string "website", :limit => 64
|
38
45
|
t.string "toll_free_phone", :limit => 32
|
39
46
|
t.string "phone", :limit => 32
|
40
47
|
t.string "fax", :limit => 32
|
41
48
|
t.datetime "deleted_at"
|
42
|
-
t.datetime "created_at"
|
43
|
-
t.datetime "updated_at"
|
49
|
+
t.datetime "created_at"
|
50
|
+
t.datetime "updated_at"
|
44
51
|
t.string "email", :limit => 64
|
45
52
|
t.string "background_info"
|
46
|
-
t.integer "rating",
|
53
|
+
t.integer "rating", :default => 0, :null => false
|
47
54
|
t.string "category", :limit => 32
|
48
55
|
end
|
49
56
|
|
@@ -57,8 +64,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
57
64
|
t.string "action", :limit => 32, :default => "created"
|
58
65
|
t.string "info", :default => ""
|
59
66
|
t.boolean "private", :default => false
|
60
|
-
t.datetime "created_at"
|
61
|
-
t.datetime "updated_at"
|
67
|
+
t.datetime "created_at"
|
68
|
+
t.datetime "updated_at"
|
62
69
|
end
|
63
70
|
|
64
71
|
add_index "activities", ["created_at"], :name => "index_activities_on_created_at"
|
@@ -75,13 +82,20 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
75
82
|
t.string "address_type", :limit => 16
|
76
83
|
t.integer "addressable_id"
|
77
84
|
t.string "addressable_type"
|
78
|
-
t.datetime "created_at"
|
79
|
-
t.datetime "updated_at"
|
85
|
+
t.datetime "created_at"
|
86
|
+
t.datetime "updated_at"
|
80
87
|
t.datetime "deleted_at"
|
81
88
|
end
|
82
89
|
|
83
90
|
add_index "addresses", ["addressable_id", "addressable_type"], :name => "index_addresses_on_addressable_id_and_addressable_type"
|
84
91
|
|
92
|
+
create_table "application_accounts", :force => true do |t|
|
93
|
+
t.string "name"
|
94
|
+
t.string "single_access_token", :null => false
|
95
|
+
t.datetime "created_at"
|
96
|
+
t.datetime "updated_at"
|
97
|
+
end
|
98
|
+
|
85
99
|
create_table "avatars", :force => true do |t|
|
86
100
|
t.integer "user_id"
|
87
101
|
t.integer "entity_id"
|
@@ -89,8 +103,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
89
103
|
t.integer "image_file_size"
|
90
104
|
t.string "image_file_name"
|
91
105
|
t.string "image_content_type"
|
92
|
-
t.datetime "created_at"
|
93
|
-
t.datetime "updated_at"
|
106
|
+
t.datetime "created_at"
|
107
|
+
t.datetime "updated_at"
|
94
108
|
end
|
95
109
|
|
96
110
|
create_table "campaigns", :force => true do |t|
|
@@ -110,8 +124,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
110
124
|
t.date "ends_on"
|
111
125
|
t.text "objectives"
|
112
126
|
t.datetime "deleted_at"
|
113
|
-
t.datetime "created_at"
|
114
|
-
t.datetime "updated_at"
|
127
|
+
t.datetime "created_at"
|
128
|
+
t.datetime "updated_at"
|
115
129
|
t.string "background_info"
|
116
130
|
end
|
117
131
|
|
@@ -125,18 +139,25 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
125
139
|
t.boolean "private"
|
126
140
|
t.string "title", :default => ""
|
127
141
|
t.text "comment"
|
128
|
-
t.datetime "created_at"
|
129
|
-
t.datetime "updated_at"
|
142
|
+
t.datetime "created_at"
|
143
|
+
t.datetime "updated_at"
|
130
144
|
t.string "state", :limit => 16, :default => "Expanded", :null => false
|
131
145
|
end
|
132
146
|
|
147
|
+
create_table "contact_aliases", :force => true do |t|
|
148
|
+
t.integer "contact_id"
|
149
|
+
t.integer "destroyed_contact_id"
|
150
|
+
t.datetime "created_at"
|
151
|
+
t.datetime "updated_at"
|
152
|
+
end
|
153
|
+
|
133
154
|
create_table "contact_opportunities", :force => true do |t|
|
134
155
|
t.integer "contact_id"
|
135
156
|
t.integer "opportunity_id"
|
136
157
|
t.string "role", :limit => 32
|
137
158
|
t.datetime "deleted_at"
|
138
|
-
t.datetime "created_at"
|
139
|
-
t.datetime "updated_at"
|
159
|
+
t.datetime "created_at"
|
160
|
+
t.datetime "updated_at"
|
140
161
|
end
|
141
162
|
|
142
163
|
create_table "contacts", :force => true do |t|
|
@@ -144,8 +165,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
144
165
|
t.integer "lead_id"
|
145
166
|
t.integer "assigned_to"
|
146
167
|
t.integer "reports_to"
|
147
|
-
t.string "first_name",
|
148
|
-
t.string "last_name",
|
168
|
+
t.string "first_name", :default => ""
|
169
|
+
t.string "last_name", :default => ""
|
149
170
|
t.string "access", :limit => 8, :default => "Public"
|
150
171
|
t.string "title", :limit => 64
|
151
172
|
t.string "department", :limit => 64
|
@@ -162,14 +183,14 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
162
183
|
t.date "born_on"
|
163
184
|
t.boolean "do_not_call", :default => false, :null => false
|
164
185
|
t.datetime "deleted_at"
|
165
|
-
t.datetime "created_at"
|
166
|
-
t.datetime "updated_at"
|
186
|
+
t.datetime "created_at"
|
187
|
+
t.datetime "updated_at"
|
167
188
|
t.string "background_info"
|
168
189
|
t.string "skype", :limit => 128
|
169
190
|
end
|
170
191
|
|
171
192
|
add_index "contacts", ["assigned_to"], :name => "index_contacts_on_assigned_to"
|
172
|
-
add_index "contacts", ["user_id", "last_name", "deleted_at"], :name => "
|
193
|
+
add_index "contacts", ["user_id", "last_name", "deleted_at"], :name => "index_contacts_on_user_id_and_last_name_and_deleted_at", :unique => true
|
173
194
|
|
174
195
|
create_table "emails", :force => true do |t|
|
175
196
|
t.string "imap_message_id", :null => false
|
@@ -186,8 +207,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
186
207
|
t.datetime "sent_at"
|
187
208
|
t.datetime "received_at"
|
188
209
|
t.datetime "deleted_at"
|
189
|
-
t.datetime "created_at"
|
190
|
-
t.datetime "updated_at"
|
210
|
+
t.datetime "created_at"
|
211
|
+
t.datetime "updated_at"
|
191
212
|
t.string "state", :limit => 16, :default => "Expanded", :null => false
|
192
213
|
end
|
193
214
|
|
@@ -198,8 +219,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
198
219
|
t.string "label", :limit => 128
|
199
220
|
t.integer "position"
|
200
221
|
t.string "hint"
|
201
|
-
t.datetime "created_at"
|
202
|
-
t.datetime "updated_at"
|
222
|
+
t.datetime "created_at"
|
223
|
+
t.datetime "updated_at"
|
203
224
|
t.integer "tag_id"
|
204
225
|
t.string "klass_name", :limit => 32
|
205
226
|
end
|
@@ -217,8 +238,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
217
238
|
t.boolean "disabled"
|
218
239
|
t.boolean "required"
|
219
240
|
t.integer "maxlength"
|
220
|
-
t.datetime "created_at"
|
221
|
-
t.datetime "updated_at"
|
241
|
+
t.datetime "created_at"
|
242
|
+
t.datetime "updated_at"
|
222
243
|
end
|
223
244
|
|
224
245
|
add_index "fields", ["field_group_id"], :name => "index_fields_on_field_group_id"
|
@@ -247,8 +268,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
247
268
|
t.integer "rating", :default => 0, :null => false
|
248
269
|
t.boolean "do_not_call", :default => false, :null => false
|
249
270
|
t.datetime "deleted_at"
|
250
|
-
t.datetime "created_at"
|
251
|
-
t.datetime "updated_at"
|
271
|
+
t.datetime "created_at"
|
272
|
+
t.datetime "updated_at"
|
252
273
|
t.string "background_info"
|
253
274
|
t.string "skype", :limit => 128
|
254
275
|
end
|
@@ -259,8 +280,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
259
280
|
create_table "lists", :force => true do |t|
|
260
281
|
t.string "name"
|
261
282
|
t.text "url"
|
262
|
-
t.datetime "created_at"
|
263
|
-
t.datetime "updated_at"
|
283
|
+
t.datetime "created_at"
|
284
|
+
t.datetime "updated_at"
|
264
285
|
end
|
265
286
|
|
266
287
|
create_table "opportunities", :force => true do |t|
|
@@ -276,20 +297,20 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
276
297
|
t.decimal "discount", :precision => 12, :scale => 2
|
277
298
|
t.date "closes_on"
|
278
299
|
t.datetime "deleted_at"
|
279
|
-
t.datetime "created_at"
|
280
|
-
t.datetime "updated_at"
|
300
|
+
t.datetime "created_at"
|
301
|
+
t.datetime "updated_at"
|
281
302
|
t.string "background_info"
|
282
303
|
end
|
283
304
|
|
284
305
|
add_index "opportunities", ["assigned_to"], :name => "index_opportunities_on_assigned_to"
|
285
|
-
add_index "opportunities", ["user_id", "name", "deleted_at"], :name => "
|
306
|
+
add_index "opportunities", ["user_id", "name", "deleted_at"], :name => "index_opportunities_on_user_id_and_name_and_deleted_at", :unique => true
|
286
307
|
|
287
308
|
create_table "permissions", :force => true do |t|
|
288
309
|
t.integer "user_id"
|
289
310
|
t.integer "asset_id"
|
290
311
|
t.string "asset_type"
|
291
|
-
t.datetime "created_at"
|
292
|
-
t.datetime "updated_at"
|
312
|
+
t.datetime "created_at"
|
313
|
+
t.datetime "updated_at"
|
293
314
|
end
|
294
315
|
|
295
316
|
add_index "permissions", ["asset_id", "asset_type"], :name => "index_permissions_on_asset_id_and_asset_type"
|
@@ -299,8 +320,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
299
320
|
t.integer "user_id"
|
300
321
|
t.string "name", :limit => 32, :default => "", :null => false
|
301
322
|
t.text "value"
|
302
|
-
t.datetime "created_at"
|
303
|
-
t.datetime "updated_at"
|
323
|
+
t.datetime "created_at"
|
324
|
+
t.datetime "updated_at"
|
304
325
|
end
|
305
326
|
|
306
327
|
add_index "preferences", ["user_id", "name"], :name => "index_preferences_on_user_id_and_name"
|
@@ -308,8 +329,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
308
329
|
create_table "sessions", :force => true do |t|
|
309
330
|
t.string "session_id", :null => false
|
310
331
|
t.text "data"
|
311
|
-
t.datetime "created_at"
|
312
|
-
t.datetime "updated_at"
|
332
|
+
t.datetime "created_at"
|
333
|
+
t.datetime "updated_at"
|
313
334
|
end
|
314
335
|
|
315
336
|
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
|
@@ -318,8 +339,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
318
339
|
create_table "settings", :force => true do |t|
|
319
340
|
t.string "name", :limit => 32, :default => "", :null => false
|
320
341
|
t.text "value"
|
321
|
-
t.datetime "created_at"
|
322
|
-
t.datetime "updated_at"
|
342
|
+
t.datetime "created_at"
|
343
|
+
t.datetime "updated_at"
|
323
344
|
end
|
324
345
|
|
325
346
|
add_index "settings", ["name"], :name => "index_settings_on_name"
|
@@ -338,7 +359,10 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
338
359
|
add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
|
339
360
|
|
340
361
|
create_table "tags", :force => true do |t|
|
341
|
-
t.string
|
362
|
+
t.string "name"
|
363
|
+
t.datetime "created_at"
|
364
|
+
t.datetime "updated_at"
|
365
|
+
t.string "taggable_type"
|
342
366
|
end
|
343
367
|
|
344
368
|
create_table "tasks", :force => true do |t|
|
@@ -354,8 +378,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
354
378
|
t.datetime "due_at"
|
355
379
|
t.datetime "completed_at"
|
356
380
|
t.datetime "deleted_at"
|
357
|
-
t.datetime "created_at"
|
358
|
-
t.datetime "updated_at"
|
381
|
+
t.datetime "created_at"
|
382
|
+
t.datetime "updated_at"
|
359
383
|
t.string "background_info"
|
360
384
|
end
|
361
385
|
|
@@ -387,8 +411,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
387
411
|
t.string "current_login_ip"
|
388
412
|
t.integer "login_count", :default => 0, :null => false
|
389
413
|
t.datetime "deleted_at"
|
390
|
-
t.datetime "created_at"
|
391
|
-
t.datetime "updated_at"
|
414
|
+
t.datetime "created_at"
|
415
|
+
t.datetime "updated_at"
|
392
416
|
t.boolean "admin", :default => false, :null => false
|
393
417
|
t.datetime "suspended_at"
|
394
418
|
t.string "single_access_token"
|
@@ -408,6 +432,8 @@ ActiveRecord::Schema.define(:version => 20120224073107) do
|
|
408
432
|
t.text "object"
|
409
433
|
t.datetime "created_at"
|
410
434
|
t.text "object_changes"
|
435
|
+
t.integer "related_id"
|
436
|
+
t.string "related_type"
|
411
437
|
end
|
412
438
|
|
413
439
|
add_index "versions", ["item_type", "item_id"], :name => "index_versions_on_item_type_and_item_id"
|