fat_free_crm 0.15.0.beta.2 → 0.15.0

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.

Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/.docker/nginx/sites-enabled/ffcrm.conf +8 -0
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +4 -1
  5. data/.rubocop_todo.yml +190 -89
  6. data/.travis.yml +10 -3
  7. data/CHANGELOG.md +27 -0
  8. data/{CONTRIBUTORS → CONTRIBUTORS.md} +2 -1
  9. data/Dockerfile +15 -13
  10. data/Gemfile +7 -4
  11. data/Gemfile.lock +200 -167
  12. data/README.md +4 -2
  13. data/app/assets/javascripts/crm_sortable.js.coffee +5 -0
  14. data/app/assets/javascripts/timeago.js.coffee +5 -0
  15. data/app/assets/stylesheets/about.css.scss +5 -0
  16. data/app/assets/stylesheets/common.scss +2 -1
  17. data/app/controllers/admin/fields_controller.rb +1 -1
  18. data/app/controllers/admin/groups_controller.rb +5 -1
  19. data/app/controllers/admin/tags_controller.rb +1 -1
  20. data/app/controllers/admin/users_controller.rb +10 -6
  21. data/app/controllers/application_controller.rb +13 -13
  22. data/app/controllers/authentications_controller.rb +2 -2
  23. data/app/controllers/comments_controller.rb +3 -2
  24. data/app/controllers/entities/contacts_controller.rb +9 -7
  25. data/app/controllers/entities/opportunities_controller.rb +1 -1
  26. data/app/controllers/entities_controller.rb +4 -4
  27. data/app/controllers/home_controller.rb +9 -9
  28. data/app/controllers/passwords_controller.rb +1 -1
  29. data/app/controllers/tasks_controller.rb +2 -1
  30. data/app/controllers/users_controller.rb +4 -2
  31. data/app/helpers/application_helper.rb +9 -9
  32. data/app/helpers/javascript_helper.rb +5 -0
  33. data/app/helpers/opportunities_helper.rb +1 -1
  34. data/app/helpers/remote_link_pagination_helper.rb +5 -0
  35. data/app/inputs/date_pair_input.rb +1 -1
  36. data/app/models/entities/account.rb +2 -2
  37. data/app/models/entities/account_contact.rb +1 -1
  38. data/app/models/entities/campaign.rb +3 -3
  39. data/app/models/entities/contact.rb +3 -3
  40. data/app/models/entities/lead.rb +2 -2
  41. data/app/models/entities/opportunity.rb +3 -3
  42. data/app/models/fields/custom_field.rb +1 -1
  43. data/app/models/fields/custom_field_pair.rb +2 -2
  44. data/app/models/fields/field.rb +1 -1
  45. data/app/models/polymorphic/address.rb +2 -2
  46. data/app/models/polymorphic/avatar.rb +4 -2
  47. data/app/models/polymorphic/email.rb +8 -6
  48. data/app/models/polymorphic/task.rb +3 -1
  49. data/app/models/polymorphic/version.rb +3 -3
  50. data/app/models/users/ability.rb +1 -1
  51. data/app/models/users/permission.rb +2 -0
  52. data/app/models/users/user.rb +2 -2
  53. data/app/views/accounts/index.js.haml +1 -1
  54. data/app/views/admin/fields/_sort_by.html.haml +1 -1
  55. data/app/views/admin/users/_user.html.haml +1 -1
  56. data/app/views/campaigns/index.js.haml +1 -1
  57. data/app/views/contacts/index.js.haml +1 -1
  58. data/app/views/entities/_basic_search.html.haml +1 -1
  59. data/app/views/home/_duration_menu.html.haml +1 -1
  60. data/app/views/home/_events_menu.html.haml +1 -1
  61. data/app/views/home/_users_menu.html.haml +1 -1
  62. data/app/views/layouts/application.html.haml +1 -1
  63. data/app/views/leads/index.js.haml +1 -1
  64. data/app/views/opportunities/index.js.haml +1 -1
  65. data/app/views/shared/_naming.html.haml +1 -1
  66. data/app/views/users/_languages.html.haml +1 -1
  67. data/config/application.rb +2 -3
  68. data/config/boot.rb +2 -0
  69. data/config/deploy.example.rb +1 -1
  70. data/config/environments/development.rb +2 -0
  71. data/config/environments/production.rb +1 -1
  72. data/config/environments/test.rb +2 -2
  73. data/config/initializers/assets.rb +6 -1
  74. data/config/initializers/backtrace_silencers.rb +5 -0
  75. data/config/initializers/constants.rb +1 -1
  76. data/config/initializers/cookies_serializer.rb +5 -0
  77. data/config/initializers/custom_field_ransack_translations.rb +5 -0
  78. data/config/initializers/filter_parameter_logging.rb +5 -0
  79. data/config/initializers/inflections.rb +5 -0
  80. data/config/initializers/paper_trail.rb +5 -0
  81. data/config/initializers/ransack.rb +3 -3
  82. data/config/initializers/session_store.rb +5 -0
  83. data/config/initializers/wrap_parameters.rb +5 -0
  84. data/config/locales/et.yml +207 -0
  85. data/config/locales/et_fat_free_crm.yml +928 -0
  86. data/config/locales/pt-BR_ransack.yml +81 -0
  87. data/config/locales/th.rb +1 -1
  88. data/config/routes.rb +18 -18
  89. data/db/migrate/20100928030598_create_sessions.rb +1 -1
  90. data/db/migrate/20100928030599_create_users.rb +2 -2
  91. data/db/migrate/20100928030600_create_openid_tables.rb +1 -1
  92. data/db/migrate/20100928030601_create_accounts.rb +2 -2
  93. data/db/migrate/20100928030602_create_permissions.rb +1 -1
  94. data/db/migrate/20100928030603_create_settings.rb +1 -1
  95. data/db/migrate/20100928030604_create_preferences.rb +2 -2
  96. data/db/migrate/20100928030605_create_campaigns.rb +2 -2
  97. data/db/migrate/20100928030606_create_leads.rb +2 -2
  98. data/db/migrate/20100928030607_create_contacts.rb +2 -2
  99. data/db/migrate/20100928030608_create_opportunities.rb +2 -2
  100. data/db/migrate/20100928030609_create_account_contacts.rb +1 -1
  101. data/db/migrate/20100928030610_create_account_opportunities.rb +1 -1
  102. data/db/migrate/20100928030611_create_contact_opportunities.rb +1 -1
  103. data/db/migrate/20100928030612_create_tasks.rb +2 -2
  104. data/db/migrate/20100928030613_create_comments.rb +1 -1
  105. data/db/migrate/20100928030614_create_activities.rb +1 -1
  106. data/db/migrate/20100928030615_create_avatars.rb +1 -1
  107. data/db/migrate/20100928030616_rename_remember_token.rb +1 -1
  108. data/db/migrate/20100928030617_drop_openid_tables.rb +1 -1
  109. data/db/migrate/20100928030618_add_admin_to_users.rb +1 -1
  110. data/db/migrate/20100928030619_add_suspended_to_users.rb +1 -1
  111. data/db/migrate/20100928030620_remove_uuid.rb +2 -2
  112. data/db/migrate/20100928030621_add_email_to_accounts.rb +1 -1
  113. data/db/migrate/20100928030622_add_background_info_to_models.rb +1 -1
  114. data/db/migrate/20100928030623_create_addresses.rb +2 -2
  115. data/db/migrate/20100928030624_add_index_on_permissions.rb +3 -3
  116. data/db/migrate/20100928030625_create_emails.rb +2 -2
  117. data/db/migrate/20100928030626_add_state_to_timeline_objects.rb +1 -1
  118. data/db/migrate/20100928030627_acts_as_taggable_on_migration.rb +2 -2
  119. data/db/migrate/20101221123456_add_single_access_token_to_users.rb +1 -1
  120. data/db/migrate/20101221345678_add_rating_and_category_to_accounts.rb +1 -1
  121. data/db/migrate/20110719082054_add_skype_to_contacts_and_leads.rb +1 -1
  122. data/db/migrate/20111101083437_create_fields.rb +1 -1
  123. data/db/migrate/20111101090312_create_field_groups.rb +1 -1
  124. data/db/migrate/20111116091952_add_field_groups_tag_id.rb +1 -1
  125. data/db/migrate/20111117041311_change_fields_collection_to_text.rb +1 -1
  126. data/db/migrate/20111201030535_add_field_groups_klass_name.rb +2 -2
  127. data/db/migrate/20120121054235_create_lists.rb +1 -1
  128. data/db/migrate/20120216031616_create_versions.rb +3 -3
  129. data/db/migrate/20120216042541_is_paranoid_to_paper_trail.rb +1 -1
  130. data/db/migrate/20120220233724_add_versions_object_changes.rb +1 -1
  131. data/db/migrate/20120224073107_remove_default_value_and_clear_settings.rb +1 -1
  132. data/db/migrate/20120309070209_add_versions_related.rb +1 -1
  133. data/db/migrate/20120314080441_add_subscribed_users_to_entities.rb +2 -2
  134. data/db/migrate/20120316045804_activities_to_versions.rb +1 -1
  135. data/db/migrate/20120405080727_change_subscribed_users_to_set.rb +1 -1
  136. data/db/migrate/20120405080742_change_further_subscribed_users_to_set.rb +2 -2
  137. data/db/migrate/20120406082136_create_groups.rb +2 -2
  138. data/db/migrate/20120413034923_add_index_on_versions_item_type.rb +1 -1
  139. data/db/migrate/20120510025219_add_not_null_constraints_for_timestamp_columns.rb +3 -3
  140. data/db/migrate/20120528102124_increase_length_of_version_events.rb +1 -1
  141. data/db/migrate/20120801032706_add_pair_id_to_fields.rb +1 -1
  142. data/db/migrate/20121003063155_add_settings_to_custom_fields.rb +1 -1
  143. data/db/migrate/20121221033947_fix_country_mapping.rb +1 -1
  144. data/db/migrate/20131207033244_add_user_id_to_lists.rb +1 -1
  145. data/db/migrate/20140916011927_add_created_at_index_on_versions.rb +1 -1
  146. data/db/migrate/20140916012922_add_indexes_to_model_associations.rb +3 -3
  147. data/db/migrate/20141126031837_increase_email_to254_chars.rb +1 -1
  148. data/db/migrate/20141230021159_add_transaction_id_column_to_versions.rb +1 -1
  149. data/db/migrate/20141230205453_add_missing_unique_indices.acts_as_taggable_on_engine.rb +4 -4
  150. data/db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +1 -1
  151. data/db/migrate/20141230205455_add_missing_taggable_index.acts_as_taggable_on_engine.rb +3 -3
  152. data/db/migrate/20150123060900_convert_radio_to_radio_buttons.rb +1 -1
  153. data/db/migrate/20150227123054_remove_last_request_at_from_users.rb +1 -1
  154. data/db/migrate/20150427131956_create_index_related_type.rb +3 -3
  155. data/db/migrate/20160511053730_add_account_contacts_index.rb +2 -2
  156. data/docker-compose.yml +17 -13
  157. data/fat_free_crm.gemspec +4 -6
  158. data/lib/development_tasks/license.rake +12 -9
  159. data/lib/fat_free_crm/callback.rb +4 -4
  160. data/lib/fat_free_crm/engine.rb +2 -2
  161. data/lib/fat_free_crm/exportable.rb +2 -2
  162. data/lib/fat_free_crm/fields.rb +2 -4
  163. data/lib/fat_free_crm/gem_ext.rb +0 -1
  164. data/lib/fat_free_crm/gem_ext/rake/task.rb +2 -0
  165. data/lib/fat_free_crm/mail_processor/base.rb +4 -4
  166. data/lib/fat_free_crm/mail_processor/dropbox.rb +1 -1
  167. data/lib/fat_free_crm/permissions.rb +5 -5
  168. data/lib/fat_free_crm/sortable.rb +1 -1
  169. data/lib/fat_free_crm/version.rb +1 -1
  170. data/lib/gravatar_image_tag.rb +1 -0
  171. data/lib/tasks/ffcrm/demo.rake +2 -2
  172. data/spec/controllers/admin/users_controller_spec.rb +25 -25
  173. data/spec/controllers/authentications_controller_spec.rb +9 -9
  174. data/spec/controllers/comments_controller_spec.rb +15 -15
  175. data/spec/controllers/emails_controller_spec.rb +2 -2
  176. data/spec/controllers/entities/accounts_controller_spec.rb +46 -46
  177. data/spec/controllers/entities/campaigns_controller_spec.rb +46 -46
  178. data/spec/controllers/entities/contacts_controller_spec.rb +55 -55
  179. data/spec/controllers/entities/leads_controller_spec.rb +85 -85
  180. data/spec/controllers/entities/opportunities_controller_spec.rb +74 -74
  181. data/spec/controllers/home_controller_spec.rb +11 -11
  182. data/spec/controllers/passwords_controller_spec.rb +2 -2
  183. data/spec/controllers/tasks_controller_spec.rb +37 -37
  184. data/spec/controllers/users_controller_spec.rb +31 -31
  185. data/spec/factories/campaign_factories.rb +1 -1
  186. data/spec/factories/contact_factories.rb +1 -1
  187. data/spec/factories/field_factories.rb +1 -1
  188. data/spec/factories/lead_factories.rb +2 -2
  189. data/spec/factories/opportunity_factories.rb +3 -3
  190. data/spec/factories/shared_factories.rb +1 -1
  191. data/spec/factories/task_factories.rb +1 -1
  192. data/spec/features/support/browser.rb +9 -1
  193. data/spec/lib/fields_spec.rb +2 -2
  194. data/spec/lib/permissions_spec.rb +38 -6
  195. data/spec/lib/view_factory_spec.rb +2 -2
  196. data/spec/models/fields/custom_field_spec.rb +3 -3
  197. data/spec/models/observers/entity_observer_spec.rb +1 -1
  198. data/spec/models/polymorphic/version_spec.rb +11 -11
  199. data/spec/models/users/abilities/user_ability_spec.rb +8 -3
  200. data/spec/models/users/permission_spec.rb +8 -0
  201. data/spec/models/users/user_spec.rb +1 -1
  202. data/spec/shared/controllers.rb +10 -10
  203. data/spec/spec_helper.rb +1 -1
  204. data/spec/views/accounts/index.haml_spec.rb +1 -1
  205. data/spec/views/accounts/update.js.haml_spec.rb +2 -2
  206. data/spec/views/admin/users/update.js.haml_spec.rb +2 -2
  207. data/spec/views/application/auto_complete.haml_spec.rb +1 -1
  208. data/spec/views/campaigns/index.haml_spec.rb +1 -1
  209. data/spec/views/campaigns/update.js.haml_spec.rb +2 -2
  210. data/spec/views/contacts/index.haml_spec.rb +1 -1
  211. data/spec/views/contacts/update.js.haml_spec.rb +2 -2
  212. data/spec/views/home/options.js.haml_spec.rb +1 -1
  213. data/spec/views/leads/index.haml_spec.rb +1 -1
  214. data/spec/views/leads/promote.js.haml_spec.rb +2 -2
  215. data/spec/views/leads/update.js.haml_spec.rb +2 -2
  216. data/spec/views/opportunities/index.haml_spec.rb +1 -1
  217. data/spec/views/opportunities/update.js.haml_spec.rb +1 -1
  218. data/spec/views/tasks/_edit.haml_spec.rb +2 -2
  219. data/spec/views/tasks/create.js.haml_spec.rb +2 -2
  220. data/spec/views/tasks/edit.js.haml_spec.rb +1 -1
  221. data/spec/views/users/change_password.js.haml_spec.rb +2 -2
  222. data/spec/views/users/update.js.haml_spec.rb +2 -2
  223. data/spec/views/users/upload_avatar.js.haml_spec.rb +2 -2
  224. metadata +17 -20
  225. data/lib/fat_free_crm/gem_ext/active_record/schema_dumper.rb +0 -27
@@ -0,0 +1,81 @@
1
+ ---
2
+ pt-BR:
3
+ ransack:
4
+ search: pesquisar
5
+ predicate: predicado
6
+ and: e
7
+ or: ou
8
+ any: algum
9
+ all: todos
10
+ combinator: combinador
11
+ attribute: atributo
12
+ value: valor
13
+ condition: condição
14
+ sort: ordenar
15
+ asc: crescente
16
+ desc: decrescente
17
+ submit: Pesquisar
18
+ add_group: Incluir grupo de filtro(s)
19
+ group_first: Mostrar resultados que correspondam a %{combinator} abaixo
20
+ group_rest: ! '...e que correspondam a %{combinator} abaixo'
21
+ add_condition: Incluir filtro
22
+ remove_condition: Remover filtro
23
+ predicates:
24
+ eq: igual
25
+ eq_any: igual a algum
26
+ eq_all: igual a todos
27
+ not_eq: não é igual a
28
+ not_eq_any: não é igual a algum
29
+ not_eq_all: não é igual a todos
30
+ matches: corresponde
31
+ matches_any: corresponde a algum
32
+ matches_all: corresponde a todos
33
+ does_not_match: não corresponde
34
+ does_not_match_any: não corresponde a algum
35
+ does_not_match_all: não corresponde a todos
36
+ lt: menor que
37
+ lt_any: menor que algum
38
+ lt_all: menor que todos
39
+ lteq: menor ou igual a
40
+ lteq_any: menor ou igual a algum
41
+ lteq_all: menor ou igual a todos
42
+ gt: maior que
43
+ gt_any: maior que algum
44
+ gt_all: maior que todos
45
+ gteq: maior que ou igual a
46
+ gteq_any: maior que ou igual a algum
47
+ gteq_all: maior que ou igual a todos
48
+ in: em
49
+ in_any: em algum
50
+ in_all: em todos
51
+ not_in: não em
52
+ not_in_any: não em algum
53
+ not_in_all: não em todos
54
+ cont: contém
55
+ cont_any: contém algum
56
+ cont_all: contém todos
57
+ not_cont: não contém
58
+ not_cont_any: não contém algum
59
+ not_cont_all: não contém todos
60
+ start: começa com
61
+ start_any: começa com algum
62
+ start_all: começa com todos
63
+ not_start: não começa com
64
+ not_start_any: não começa com algum
65
+ not_start_all: não começa com algum
66
+ end: termina com
67
+ end_any: termina com algum
68
+ end_all: termina com todos
69
+ not_end: não termina com
70
+ not_end_any: não termina com algum
71
+ not_end_all: não termina com todos
72
+ 'true': é verdadeiro
73
+ 'false': é falso
74
+ present: está presente
75
+ blank: está em branco
76
+ 'null': é nulo
77
+ not_null: não é nulo
78
+ alt:
79
+ date:
80
+ lt: é antes de
81
+ gt: é depois de
data/config/locales/th.rb CHANGED
@@ -51,7 +51,7 @@ end
51
51
 
52
52
  month_names: [nil, "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],
53
53
  abbr_month_names: [nil, "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."],
54
- order: [:day, :month, :year]
54
+ order: %i[day month year]
55
55
  },
56
56
 
57
57
  time: {
data/config/routes.rb CHANGED
@@ -17,14 +17,14 @@ Rails.application.routes.draw do
17
17
 
18
18
  get '/home/options', as: :options
19
19
  get '/home/toggle', as: :toggle
20
- match '/home/timeline', as: :timeline, via: [:get, :put, :post]
21
- match '/home/timezone', as: :timezone, via: [:get, :put, :post]
20
+ match '/home/timeline', as: :timeline, via: %i[get put post]
21
+ match '/home/timezone', as: :timezone, via: %i[get put post]
22
22
  post '/home/redraw', as: :redraw
23
23
 
24
- resource :authentication, except: [:index, :edit]
25
- resources :comments, except: [:new, :show]
24
+ resource :authentication, except: %i[index edit]
25
+ resources :comments, except: %i[new show]
26
26
  resources :emails, only: [:destroy]
27
- resources :passwords, only: [:new, :create, :edit, :update]
27
+ resources :passwords, only: %i[new create edit update]
28
28
 
29
29
  resources :accounts, id: /\d+/ do
30
30
  collection do
@@ -32,7 +32,7 @@ Rails.application.routes.draw do
32
32
  post :filter
33
33
  get :options
34
34
  get :field_group
35
- match :auto_complete, via: [:get, :post]
35
+ match :auto_complete, via: %i[get post]
36
36
  get :redraw
37
37
  get :versions
38
38
  end
@@ -52,7 +52,7 @@ Rails.application.routes.draw do
52
52
  post :filter
53
53
  get :options
54
54
  get :field_group
55
- match :auto_complete, via: [:get, :post]
55
+ match :auto_complete, via: %i[get post]
56
56
  get :redraw
57
57
  get :versions
58
58
  end
@@ -72,7 +72,7 @@ Rails.application.routes.draw do
72
72
  post :filter
73
73
  get :options
74
74
  get :field_group
75
- match :auto_complete, via: [:get, :post]
75
+ match :auto_complete, via: %i[get post]
76
76
  get :redraw
77
77
  get :versions
78
78
  end
@@ -91,7 +91,7 @@ Rails.application.routes.draw do
91
91
  post :filter
92
92
  get :options
93
93
  get :field_group
94
- match :auto_complete, via: [:get, :post]
94
+ match :auto_complete, via: %i[get post]
95
95
  get :redraw
96
96
  get :versions
97
97
  get :autocomplete_account_name
@@ -102,7 +102,7 @@ Rails.application.routes.draw do
102
102
  post :subscribe
103
103
  post :unsubscribe
104
104
  put :attach
105
- match :promote, via: [:patch, :put]
105
+ match :promote, via: %i[patch put]
106
106
  put :reject
107
107
  end
108
108
  end
@@ -113,7 +113,7 @@ Rails.application.routes.draw do
113
113
  post :filter
114
114
  get :options
115
115
  get :field_group
116
- match :auto_complete, via: [:get, :post]
116
+ match :auto_complete, via: %i[get post]
117
117
  get :redraw
118
118
  get :versions
119
119
  end
@@ -129,7 +129,7 @@ Rails.application.routes.draw do
129
129
  resources :tasks, id: /\d+/ do
130
130
  collection do
131
131
  post :filter
132
- match :auto_complete, via: [:get, :post]
132
+ match :auto_complete, via: %i[get post]
133
133
  end
134
134
  member do
135
135
  put :complete
@@ -137,16 +137,16 @@ Rails.application.routes.draw do
137
137
  end
138
138
  end
139
139
 
140
- resources :users, id: /\d+/, except: [:index, :destroy] do
140
+ resources :users, id: /\d+/, except: %i[index destroy] do
141
141
  member do
142
142
  get :avatar
143
143
  get :password
144
- match :upload_avatar, via: [:put, :patch]
144
+ match :upload_avatar, via: %i[put patch]
145
145
  patch :change_password
146
146
  post :redraw
147
147
  end
148
148
  collection do
149
- match :auto_complete, via: [:get, :post]
149
+ match :auto_complete, via: %i[get post]
150
150
  get :opportunities_overview
151
151
  end
152
152
  end
@@ -156,7 +156,7 @@ Rails.application.routes.draw do
156
156
 
157
157
  resources :users do
158
158
  collection do
159
- match :auto_complete, via: [:get, :post]
159
+ match :auto_complete, via: %i[get post]
160
160
  end
161
161
  member do
162
162
  get :confirm
@@ -165,7 +165,7 @@ Rails.application.routes.draw do
165
165
  end
166
166
  end
167
167
 
168
- resources :field_groups, except: [:index, :show] do
168
+ resources :field_groups, except: %i[index show] do
169
169
  collection do
170
170
  post :sort
171
171
  end
@@ -176,7 +176,7 @@ Rails.application.routes.draw do
176
176
 
177
177
  resources :fields do
178
178
  collection do
179
- match :auto_complete, via: [:get, :post]
179
+ match :auto_complete, via: %i[get post]
180
180
  get :options
181
181
  get :redraw
182
182
  post :sort
@@ -1,4 +1,4 @@
1
- class CreateSessions < ActiveRecord::Migration
1
+ class CreateSessions < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  # Set the following global variable to show that we are migrating
4
4
  # from a brand new database. Future migrations can detect this, and
@@ -1,4 +1,4 @@
1
- class CreateUsers < ActiveRecord::Migration
1
+ class CreateUsers < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :users, force: true do |t|
4
4
  t.string :uuid, limit: 36
@@ -32,7 +32,7 @@ class CreateUsers < ActiveRecord::Migration
32
32
  t.timestamps
33
33
  end
34
34
 
35
- add_index :users, [:username, :deleted_at], unique: true
35
+ add_index :users, %i[username deleted_at], unique: true
36
36
  add_index :users, :email
37
37
  add_index :users, :last_request_at
38
38
  add_index :users, :remember_token
@@ -1,4 +1,4 @@
1
- class CreateOpenidTables < ActiveRecord::Migration
1
+ class CreateOpenidTables < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :open_id_authentication_associations, force: true do |t|
4
4
  t.integer :issued
@@ -1,4 +1,4 @@
1
- class CreateAccounts < ActiveRecord::Migration
1
+ class CreateAccounts < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :accounts, force: true do |t|
4
4
  t.string :uuid, limit: 36
@@ -16,7 +16,7 @@ class CreateAccounts < ActiveRecord::Migration
16
16
  t.timestamps
17
17
  end
18
18
 
19
- add_index :accounts, [:user_id, :name, :deleted_at], unique: true
19
+ add_index :accounts, %i[user_id name deleted_at], unique: true
20
20
  add_index :accounts, :assigned_to
21
21
  end
22
22
 
@@ -1,4 +1,4 @@
1
- class CreatePermissions < ActiveRecord::Migration
1
+ class CreatePermissions < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :permissions, force: true do |t|
4
4
  t.references :user # User who is allowed to access the asset.
@@ -1,4 +1,4 @@
1
- class CreateSettings < ActiveRecord::Migration
1
+ class CreateSettings < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :settings, force: true do |t|
4
4
  t.string :name, limit: 32, null: false, default: ""
@@ -1,4 +1,4 @@
1
- class CreatePreferences < ActiveRecord::Migration
1
+ class CreatePreferences < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :preferences do |t|
4
4
  t.references :user
@@ -6,7 +6,7 @@ class CreatePreferences < ActiveRecord::Migration
6
6
  t.text :value
7
7
  t.timestamps
8
8
  end
9
- add_index :preferences, [:user_id, :name]
9
+ add_index :preferences, %i[user_id name]
10
10
  end
11
11
 
12
12
  def self.down
@@ -1,4 +1,4 @@
1
- class CreateCampaigns < ActiveRecord::Migration
1
+ class CreateCampaigns < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :campaigns, force: true do |t|
4
4
  t.string :uuid, limit: 36
@@ -24,7 +24,7 @@ class CreateCampaigns < ActiveRecord::Migration
24
24
  t.timestamps
25
25
  end
26
26
 
27
- add_index :campaigns, [:user_id, :name, :deleted_at], unique: true
27
+ add_index :campaigns, %i[user_id name deleted_at], unique: true
28
28
  add_index :campaigns, :assigned_to
29
29
  end
30
30
 
@@ -1,4 +1,4 @@
1
- class CreateLeads < ActiveRecord::Migration
1
+ class CreateLeads < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :leads, force: true do |t|
4
4
  t.string :uuid, limit: 36
@@ -28,7 +28,7 @@ class CreateLeads < ActiveRecord::Migration
28
28
  t.timestamps
29
29
  end
30
30
 
31
- add_index :leads, [:user_id, :last_name, :deleted_at], unique: true
31
+ add_index :leads, %i[user_id last_name deleted_at], unique: true
32
32
  add_index :leads, :assigned_to
33
33
  end
34
34
 
@@ -1,4 +1,4 @@
1
- class CreateContacts < ActiveRecord::Migration
1
+ class CreateContacts < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :contacts, force: true do |t|
4
4
  t.string :uuid, limit: 36
@@ -28,7 +28,7 @@ class CreateContacts < ActiveRecord::Migration
28
28
  t.timestamps
29
29
  end
30
30
 
31
- add_index :contacts, [:user_id, :last_name, :deleted_at], unique: true, name: 'id_last_name_deleted'
31
+ add_index :contacts, %i[user_id last_name deleted_at], unique: true, name: 'id_last_name_deleted'
32
32
  add_index :contacts, :assigned_to
33
33
  end
34
34
 
@@ -1,4 +1,4 @@
1
- class CreateOpportunities < ActiveRecord::Migration
1
+ class CreateOpportunities < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :opportunities, force: true do |t|
4
4
  t.string :uuid, limit: 36
@@ -17,7 +17,7 @@ class CreateOpportunities < ActiveRecord::Migration
17
17
  t.timestamps
18
18
  end
19
19
 
20
- add_index :opportunities, [:user_id, :name, :deleted_at], unique: true, name: 'id_name_deleted'
20
+ add_index :opportunities, %i[user_id name deleted_at], unique: true, name: 'id_name_deleted'
21
21
  add_index :opportunities, :assigned_to
22
22
  end
23
23
 
@@ -1,4 +1,4 @@
1
- class CreateAccountContacts < ActiveRecord::Migration
1
+ class CreateAccountContacts < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :account_contacts, force: true do |t|
4
4
  t.references :account
@@ -1,4 +1,4 @@
1
- class CreateAccountOpportunities < ActiveRecord::Migration
1
+ class CreateAccountOpportunities < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :account_opportunities, force: true do |t|
4
4
  t.references :account
@@ -1,4 +1,4 @@
1
- class CreateContactOpportunities < ActiveRecord::Migration
1
+ class CreateContactOpportunities < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :contact_opportunities, force: true do |t|
4
4
  t.references :contact
@@ -1,4 +1,4 @@
1
- class CreateTasks < ActiveRecord::Migration
1
+ class CreateTasks < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :tasks, force: true do |t|
4
4
  t.string :uuid, limit: 36
@@ -16,7 +16,7 @@ class CreateTasks < ActiveRecord::Migration
16
16
  t.timestamps
17
17
  end
18
18
 
19
- add_index :tasks, [:user_id, :name, :deleted_at], unique: true
19
+ add_index :tasks, %i[user_id name deleted_at], unique: true
20
20
  add_index :tasks, :assigned_to
21
21
  end
22
22
 
@@ -1,4 +1,4 @@
1
- class CreateComments < ActiveRecord::Migration
1
+ class CreateComments < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :comments, force: true do |t|
4
4
  t.references :user
@@ -1,4 +1,4 @@
1
- class CreateActivities < ActiveRecord::Migration
1
+ class CreateActivities < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :activities, force: true do |t|
4
4
  t.references :user # User who's activity gets recorded.
@@ -1,4 +1,4 @@
1
- class CreateAvatars < ActiveRecord::Migration
1
+ class CreateAvatars < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  create_table :avatars do |t|
4
4
  t.references :user # Who uploaded the avatar.
@@ -1,4 +1,4 @@
1
- class RenameRememberToken < ActiveRecord::Migration
1
+ class RenameRememberToken < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  rename_column :users, :remember_token, :persistence_token
4
4
  remove_column :users, :openid_identifier
@@ -1,4 +1,4 @@
1
- class DropOpenidTables < ActiveRecord::Migration
1
+ class DropOpenidTables < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  drop_table :open_id_authentication_associations
4
4
  drop_table :open_id_authentication_nonces
@@ -1,4 +1,4 @@
1
- class AddAdminToUsers < ActiveRecord::Migration
1
+ class AddAdminToUsers < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  add_column :users, :admin, :boolean, null: false, default: false
4
4
  superuser = User.first
@@ -1,4 +1,4 @@
1
- class AddSuspendedToUsers < ActiveRecord::Migration
1
+ class AddSuspendedToUsers < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  add_column :users, :suspended_at, :datetime
4
4
  rename_column :accounts, :tall_free_phone, :toll_free_phone
@@ -1,8 +1,8 @@
1
- class RemoveUuid < ActiveRecord::Migration
1
+ class RemoveUuid < ActiveRecord::Migration[4.2]
2
2
  @@uuid_configured = false
3
3
 
4
4
  def self.up
5
- [:users, :accounts, :campaigns, :leads, :contacts, :opportunities, :tasks].each do |table|
5
+ %i[users accounts campaigns leads contacts opportunities tasks].each do |table|
6
6
  remove_column table, :uuid
7
7
  execute("DROP TRIGGER IF EXISTS #{table}_uuid") if uuid_configured?
8
8
  end