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.
- checksums.yaml +4 -4
- data/.docker/nginx/sites-enabled/ffcrm.conf +8 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +4 -1
- data/.rubocop_todo.yml +190 -89
- data/.travis.yml +10 -3
- data/CHANGELOG.md +27 -0
- data/{CONTRIBUTORS → CONTRIBUTORS.md} +2 -1
- data/Dockerfile +15 -13
- data/Gemfile +7 -4
- data/Gemfile.lock +200 -167
- data/README.md +4 -2
- data/app/assets/javascripts/crm_sortable.js.coffee +5 -0
- data/app/assets/javascripts/timeago.js.coffee +5 -0
- data/app/assets/stylesheets/about.css.scss +5 -0
- data/app/assets/stylesheets/common.scss +2 -1
- data/app/controllers/admin/fields_controller.rb +1 -1
- data/app/controllers/admin/groups_controller.rb +5 -1
- data/app/controllers/admin/tags_controller.rb +1 -1
- data/app/controllers/admin/users_controller.rb +10 -6
- data/app/controllers/application_controller.rb +13 -13
- data/app/controllers/authentications_controller.rb +2 -2
- data/app/controllers/comments_controller.rb +3 -2
- data/app/controllers/entities/contacts_controller.rb +9 -7
- data/app/controllers/entities/opportunities_controller.rb +1 -1
- data/app/controllers/entities_controller.rb +4 -4
- data/app/controllers/home_controller.rb +9 -9
- data/app/controllers/passwords_controller.rb +1 -1
- data/app/controllers/tasks_controller.rb +2 -1
- data/app/controllers/users_controller.rb +4 -2
- data/app/helpers/application_helper.rb +9 -9
- data/app/helpers/javascript_helper.rb +5 -0
- data/app/helpers/opportunities_helper.rb +1 -1
- data/app/helpers/remote_link_pagination_helper.rb +5 -0
- data/app/inputs/date_pair_input.rb +1 -1
- data/app/models/entities/account.rb +2 -2
- data/app/models/entities/account_contact.rb +1 -1
- data/app/models/entities/campaign.rb +3 -3
- data/app/models/entities/contact.rb +3 -3
- data/app/models/entities/lead.rb +2 -2
- data/app/models/entities/opportunity.rb +3 -3
- data/app/models/fields/custom_field.rb +1 -1
- data/app/models/fields/custom_field_pair.rb +2 -2
- data/app/models/fields/field.rb +1 -1
- data/app/models/polymorphic/address.rb +2 -2
- data/app/models/polymorphic/avatar.rb +4 -2
- data/app/models/polymorphic/email.rb +8 -6
- data/app/models/polymorphic/task.rb +3 -1
- data/app/models/polymorphic/version.rb +3 -3
- data/app/models/users/ability.rb +1 -1
- data/app/models/users/permission.rb +2 -0
- data/app/models/users/user.rb +2 -2
- data/app/views/accounts/index.js.haml +1 -1
- data/app/views/admin/fields/_sort_by.html.haml +1 -1
- data/app/views/admin/users/_user.html.haml +1 -1
- data/app/views/campaigns/index.js.haml +1 -1
- data/app/views/contacts/index.js.haml +1 -1
- data/app/views/entities/_basic_search.html.haml +1 -1
- data/app/views/home/_duration_menu.html.haml +1 -1
- data/app/views/home/_events_menu.html.haml +1 -1
- data/app/views/home/_users_menu.html.haml +1 -1
- data/app/views/layouts/application.html.haml +1 -1
- data/app/views/leads/index.js.haml +1 -1
- data/app/views/opportunities/index.js.haml +1 -1
- data/app/views/shared/_naming.html.haml +1 -1
- data/app/views/users/_languages.html.haml +1 -1
- data/config/application.rb +2 -3
- data/config/boot.rb +2 -0
- data/config/deploy.example.rb +1 -1
- data/config/environments/development.rb +2 -0
- data/config/environments/production.rb +1 -1
- data/config/environments/test.rb +2 -2
- data/config/initializers/assets.rb +6 -1
- data/config/initializers/backtrace_silencers.rb +5 -0
- data/config/initializers/constants.rb +1 -1
- data/config/initializers/cookies_serializer.rb +5 -0
- data/config/initializers/custom_field_ransack_translations.rb +5 -0
- data/config/initializers/filter_parameter_logging.rb +5 -0
- data/config/initializers/inflections.rb +5 -0
- data/config/initializers/paper_trail.rb +5 -0
- data/config/initializers/ransack.rb +3 -3
- data/config/initializers/session_store.rb +5 -0
- data/config/initializers/wrap_parameters.rb +5 -0
- data/config/locales/et.yml +207 -0
- data/config/locales/et_fat_free_crm.yml +928 -0
- data/config/locales/pt-BR_ransack.yml +81 -0
- data/config/locales/th.rb +1 -1
- data/config/routes.rb +18 -18
- data/db/migrate/20100928030598_create_sessions.rb +1 -1
- data/db/migrate/20100928030599_create_users.rb +2 -2
- data/db/migrate/20100928030600_create_openid_tables.rb +1 -1
- data/db/migrate/20100928030601_create_accounts.rb +2 -2
- data/db/migrate/20100928030602_create_permissions.rb +1 -1
- data/db/migrate/20100928030603_create_settings.rb +1 -1
- data/db/migrate/20100928030604_create_preferences.rb +2 -2
- data/db/migrate/20100928030605_create_campaigns.rb +2 -2
- data/db/migrate/20100928030606_create_leads.rb +2 -2
- data/db/migrate/20100928030607_create_contacts.rb +2 -2
- data/db/migrate/20100928030608_create_opportunities.rb +2 -2
- data/db/migrate/20100928030609_create_account_contacts.rb +1 -1
- data/db/migrate/20100928030610_create_account_opportunities.rb +1 -1
- data/db/migrate/20100928030611_create_contact_opportunities.rb +1 -1
- data/db/migrate/20100928030612_create_tasks.rb +2 -2
- data/db/migrate/20100928030613_create_comments.rb +1 -1
- data/db/migrate/20100928030614_create_activities.rb +1 -1
- data/db/migrate/20100928030615_create_avatars.rb +1 -1
- data/db/migrate/20100928030616_rename_remember_token.rb +1 -1
- data/db/migrate/20100928030617_drop_openid_tables.rb +1 -1
- data/db/migrate/20100928030618_add_admin_to_users.rb +1 -1
- data/db/migrate/20100928030619_add_suspended_to_users.rb +1 -1
- data/db/migrate/20100928030620_remove_uuid.rb +2 -2
- data/db/migrate/20100928030621_add_email_to_accounts.rb +1 -1
- data/db/migrate/20100928030622_add_background_info_to_models.rb +1 -1
- data/db/migrate/20100928030623_create_addresses.rb +2 -2
- data/db/migrate/20100928030624_add_index_on_permissions.rb +3 -3
- data/db/migrate/20100928030625_create_emails.rb +2 -2
- data/db/migrate/20100928030626_add_state_to_timeline_objects.rb +1 -1
- data/db/migrate/20100928030627_acts_as_taggable_on_migration.rb +2 -2
- data/db/migrate/20101221123456_add_single_access_token_to_users.rb +1 -1
- data/db/migrate/20101221345678_add_rating_and_category_to_accounts.rb +1 -1
- data/db/migrate/20110719082054_add_skype_to_contacts_and_leads.rb +1 -1
- data/db/migrate/20111101083437_create_fields.rb +1 -1
- data/db/migrate/20111101090312_create_field_groups.rb +1 -1
- data/db/migrate/20111116091952_add_field_groups_tag_id.rb +1 -1
- data/db/migrate/20111117041311_change_fields_collection_to_text.rb +1 -1
- data/db/migrate/20111201030535_add_field_groups_klass_name.rb +2 -2
- data/db/migrate/20120121054235_create_lists.rb +1 -1
- data/db/migrate/20120216031616_create_versions.rb +3 -3
- data/db/migrate/20120216042541_is_paranoid_to_paper_trail.rb +1 -1
- data/db/migrate/20120220233724_add_versions_object_changes.rb +1 -1
- data/db/migrate/20120224073107_remove_default_value_and_clear_settings.rb +1 -1
- data/db/migrate/20120309070209_add_versions_related.rb +1 -1
- data/db/migrate/20120314080441_add_subscribed_users_to_entities.rb +2 -2
- data/db/migrate/20120316045804_activities_to_versions.rb +1 -1
- data/db/migrate/20120405080727_change_subscribed_users_to_set.rb +1 -1
- data/db/migrate/20120405080742_change_further_subscribed_users_to_set.rb +2 -2
- data/db/migrate/20120406082136_create_groups.rb +2 -2
- data/db/migrate/20120413034923_add_index_on_versions_item_type.rb +1 -1
- data/db/migrate/20120510025219_add_not_null_constraints_for_timestamp_columns.rb +3 -3
- data/db/migrate/20120528102124_increase_length_of_version_events.rb +1 -1
- data/db/migrate/20120801032706_add_pair_id_to_fields.rb +1 -1
- data/db/migrate/20121003063155_add_settings_to_custom_fields.rb +1 -1
- data/db/migrate/20121221033947_fix_country_mapping.rb +1 -1
- data/db/migrate/20131207033244_add_user_id_to_lists.rb +1 -1
- data/db/migrate/20140916011927_add_created_at_index_on_versions.rb +1 -1
- data/db/migrate/20140916012922_add_indexes_to_model_associations.rb +3 -3
- data/db/migrate/20141126031837_increase_email_to254_chars.rb +1 -1
- data/db/migrate/20141230021159_add_transaction_id_column_to_versions.rb +1 -1
- data/db/migrate/20141230205453_add_missing_unique_indices.acts_as_taggable_on_engine.rb +4 -4
- data/db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +1 -1
- data/db/migrate/20141230205455_add_missing_taggable_index.acts_as_taggable_on_engine.rb +3 -3
- data/db/migrate/20150123060900_convert_radio_to_radio_buttons.rb +1 -1
- data/db/migrate/20150227123054_remove_last_request_at_from_users.rb +1 -1
- data/db/migrate/20150427131956_create_index_related_type.rb +3 -3
- data/db/migrate/20160511053730_add_account_contacts_index.rb +2 -2
- data/docker-compose.yml +17 -13
- data/fat_free_crm.gemspec +4 -6
- data/lib/development_tasks/license.rake +12 -9
- data/lib/fat_free_crm/callback.rb +4 -4
- data/lib/fat_free_crm/engine.rb +2 -2
- data/lib/fat_free_crm/exportable.rb +2 -2
- data/lib/fat_free_crm/fields.rb +2 -4
- data/lib/fat_free_crm/gem_ext.rb +0 -1
- data/lib/fat_free_crm/gem_ext/rake/task.rb +2 -0
- data/lib/fat_free_crm/mail_processor/base.rb +4 -4
- data/lib/fat_free_crm/mail_processor/dropbox.rb +1 -1
- data/lib/fat_free_crm/permissions.rb +5 -5
- data/lib/fat_free_crm/sortable.rb +1 -1
- data/lib/fat_free_crm/version.rb +1 -1
- data/lib/gravatar_image_tag.rb +1 -0
- data/lib/tasks/ffcrm/demo.rake +2 -2
- data/spec/controllers/admin/users_controller_spec.rb +25 -25
- data/spec/controllers/authentications_controller_spec.rb +9 -9
- data/spec/controllers/comments_controller_spec.rb +15 -15
- data/spec/controllers/emails_controller_spec.rb +2 -2
- data/spec/controllers/entities/accounts_controller_spec.rb +46 -46
- data/spec/controllers/entities/campaigns_controller_spec.rb +46 -46
- data/spec/controllers/entities/contacts_controller_spec.rb +55 -55
- data/spec/controllers/entities/leads_controller_spec.rb +85 -85
- data/spec/controllers/entities/opportunities_controller_spec.rb +74 -74
- data/spec/controllers/home_controller_spec.rb +11 -11
- data/spec/controllers/passwords_controller_spec.rb +2 -2
- data/spec/controllers/tasks_controller_spec.rb +37 -37
- data/spec/controllers/users_controller_spec.rb +31 -31
- data/spec/factories/campaign_factories.rb +1 -1
- data/spec/factories/contact_factories.rb +1 -1
- data/spec/factories/field_factories.rb +1 -1
- data/spec/factories/lead_factories.rb +2 -2
- data/spec/factories/opportunity_factories.rb +3 -3
- data/spec/factories/shared_factories.rb +1 -1
- data/spec/factories/task_factories.rb +1 -1
- data/spec/features/support/browser.rb +9 -1
- data/spec/lib/fields_spec.rb +2 -2
- data/spec/lib/permissions_spec.rb +38 -6
- data/spec/lib/view_factory_spec.rb +2 -2
- data/spec/models/fields/custom_field_spec.rb +3 -3
- data/spec/models/observers/entity_observer_spec.rb +1 -1
- data/spec/models/polymorphic/version_spec.rb +11 -11
- data/spec/models/users/abilities/user_ability_spec.rb +8 -3
- data/spec/models/users/permission_spec.rb +8 -0
- data/spec/models/users/user_spec.rb +1 -1
- data/spec/shared/controllers.rb +10 -10
- data/spec/spec_helper.rb +1 -1
- data/spec/views/accounts/index.haml_spec.rb +1 -1
- data/spec/views/accounts/update.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/update.js.haml_spec.rb +2 -2
- data/spec/views/application/auto_complete.haml_spec.rb +1 -1
- data/spec/views/campaigns/index.haml_spec.rb +1 -1
- data/spec/views/campaigns/update.js.haml_spec.rb +2 -2
- data/spec/views/contacts/index.haml_spec.rb +1 -1
- data/spec/views/contacts/update.js.haml_spec.rb +2 -2
- data/spec/views/home/options.js.haml_spec.rb +1 -1
- data/spec/views/leads/index.haml_spec.rb +1 -1
- data/spec/views/leads/promote.js.haml_spec.rb +2 -2
- data/spec/views/leads/update.js.haml_spec.rb +2 -2
- data/spec/views/opportunities/index.haml_spec.rb +1 -1
- data/spec/views/opportunities/update.js.haml_spec.rb +1 -1
- data/spec/views/tasks/_edit.haml_spec.rb +2 -2
- data/spec/views/tasks/create.js.haml_spec.rb +2 -2
- data/spec/views/tasks/edit.js.haml_spec.rb +1 -1
- data/spec/views/users/change_password.js.haml_spec.rb +2 -2
- data/spec/views/users/update.js.haml_spec.rb +2 -2
- data/spec/views/users/upload_avatar.js.haml_spec.rb +2 -2
- metadata +17 -20
- 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: [
|
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: [
|
21
|
-
match '/home/timezone', as: :timezone, via: [
|
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: [
|
25
|
-
resources :comments, except: [
|
24
|
+
resource :authentication, except: %i[index edit]
|
25
|
+
resources :comments, except: %i[new show]
|
26
26
|
resources :emails, only: [:destroy]
|
27
|
-
resources :passwords, only: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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: [
|
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 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, [
|
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 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, [
|
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 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, [
|
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, [
|
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, [
|
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, [
|
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, [
|
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 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, [
|
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,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
|
-
[
|
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
|