fat_free_crm 0.13.6 → 0.14.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/.rubocop.yml +5 -0
- data/.travis.yml +8 -5
- data/CHANGELOG +26 -0
- data/Gemfile +26 -26
- data/Gemfile.lock +280 -250
- data/Guardfile +0 -1
- data/README.md +7 -9
- data/Rakefile +1 -1
- data/app/assets/javascripts/application.js.erb +1 -0
- data/app/assets/javascripts/crm.js.coffee +6 -7
- data/app/assets/javascripts/search.js.coffee +7 -1
- data/app/assets/stylesheets/about.css.scss +10 -0
- data/app/assets/stylesheets/application.css.erb +2 -0
- data/app/assets/stylesheets/common.scss +1 -1
- data/app/controllers/admin/application_controller.rb +3 -3
- data/app/controllers/admin/field_groups_controller.rb +12 -7
- data/app/controllers/admin/fields_controller.rb +21 -17
- data/app/controllers/admin/groups_controller.rb +10 -4
- data/app/controllers/admin/plugins_controller.rb +1 -2
- data/app/controllers/admin/settings_controller.rb +1 -2
- data/app/controllers/admin/tags_controller.rb +10 -4
- data/app/controllers/admin/users_controller.rb +32 -12
- data/app/controllers/application_controller.rb +58 -38
- data/app/controllers/authentications_controller.rb +5 -8
- data/app/controllers/comments_controller.rb +15 -11
- data/app/controllers/emails_controller.rb +1 -2
- data/app/controllers/entities/accounts_controller.rb +20 -20
- data/app/controllers/entities/campaigns_controller.rb +25 -22
- data/app/controllers/entities/contacts_controller.rb +25 -24
- data/app/controllers/entities/leads_controller.rb +33 -31
- data/app/controllers/entities/opportunities_controller.rb +31 -28
- data/app/controllers/entities_controller.rb +26 -22
- data/app/controllers/home_controller.rb +18 -18
- data/app/controllers/lists_controller.rb +11 -7
- data/app/controllers/passwords_controller.rb +5 -6
- data/app/controllers/tasks_controller.rb +23 -18
- data/app/controllers/users_controller.rb +31 -7
- data/app/helpers/accounts_helper.rb +40 -42
- data/app/helpers/addresses_helper.rb +1 -3
- data/app/helpers/admin/application_helper.rb +4 -4
- data/app/helpers/admin/field_groups_helper.rb +5 -7
- data/app/helpers/admin/fields_helper.rb +2 -3
- data/app/helpers/admin/plugins_helper.rb +0 -1
- data/app/helpers/admin/settings_helper.rb +0 -1
- data/app/helpers/admin/tags_helper.rb +1 -1
- data/app/helpers/admin/users_helper.rb +16 -18
- data/app/helpers/application_helper.rb +127 -119
- data/app/helpers/authentications_helper.rb +0 -1
- data/app/helpers/campaigns_helper.rb +5 -7
- data/app/helpers/comments_helper.rb +0 -1
- data/app/helpers/contacts_helper.rb +0 -1
- data/app/helpers/home_helper.rb +14 -14
- data/app/helpers/javascript_helper.rb +30 -0
- data/app/helpers/leads_helper.rb +7 -7
- data/app/helpers/opportunities_helper.rb +8 -10
- data/app/helpers/passwords_helper.rb +0 -1
- data/app/helpers/tags_helper.rb +1 -3
- data/app/helpers/tasks_helper.rb +24 -26
- data/app/helpers/users_helper.rb +6 -7
- data/app/helpers/versions_helper.rb +3 -5
- data/app/inputs/date_pair_input.rb +6 -7
- data/app/inputs/date_time_input.rb +3 -4
- data/app/inputs/datetime_pair_input.rb +0 -1
- data/app/inputs/text_input.rb +2 -2
- data/app/mailers/dropbox_mailer.rb +4 -7
- data/app/mailers/subscription_mailer.rb +4 -5
- data/app/mailers/user_mailer.rb +7 -9
- data/app/models/entities/account.rb +31 -28
- data/app/models/entities/account_contact.rb +2 -1
- data/app/models/entities/account_opportunity.rb +1 -1
- data/app/models/entities/campaign.rb +22 -19
- data/app/models/entities/contact.rb +55 -53
- data/app/models/entities/contact_opportunity.rb +1 -1
- data/app/models/entities/lead.rb +49 -41
- data/app/models/entities/opportunity.rb +38 -38
- data/app/models/fields/custom_field.rb +21 -27
- data/app/models/fields/custom_field_date_pair.rb +7 -8
- data/app/models/fields/custom_field_datetime_pair.rb +0 -2
- data/app/models/fields/custom_field_pair.rb +8 -10
- data/app/models/fields/field.rb +29 -30
- data/app/models/fields/field_group.rb +4 -4
- data/app/models/list.rb +1 -1
- data/app/models/observers/entity_observer.rb +1 -1
- data/app/models/observers/lead_observer.rb +1 -1
- data/app/models/observers/opportunity_observer.rb +1 -1
- data/app/models/observers/task_observer.rb +1 -1
- data/app/models/polymorphic/address.rb +7 -7
- data/app/models/polymorphic/avatar.rb +8 -9
- data/app/models/polymorphic/comment.rb +16 -10
- data/app/models/polymorphic/email.rb +13 -6
- data/app/models/polymorphic/tag.rb +2 -2
- data/app/models/polymorphic/task.rb +45 -45
- data/{config/initializers/paper_trail.rb → app/models/polymorphic/version.rb} +26 -31
- data/app/models/setting.rb +12 -17
- data/app/models/users/ability.rb +5 -6
- data/app/models/users/authentication.rb +6 -5
- data/app/models/users/group.rb +1 -3
- data/app/models/users/permission.rb +3 -3
- data/app/models/users/preference.rb +7 -7
- data/app/models/users/user.rb +36 -43
- data/app/views/accounts/_top_section.html.haml +2 -2
- data/app/views/accounts/edit.js.haml +0 -1
- data/app/views/admin/fields/_field.html.haml +1 -1
- data/app/views/admin/tags/_tag.html.haml +1 -1
- data/app/views/admin/users/_user.html.haml +4 -4
- data/app/views/campaigns/_top_section.html.haml +1 -1
- data/app/views/campaigns/edit.js.haml +0 -2
- data/app/views/contacts/_top_section.html.haml +1 -1
- data/app/views/contacts/edit.js.haml +0 -1
- data/app/views/entities/_basic_search.html.haml +1 -1
- data/app/views/home/_account.html.haml +2 -2
- data/app/views/home/_opportunity.html.haml +2 -2
- data/app/views/layouts/_about.html.haml +1 -1
- data/app/views/leads/_top_section.html.haml +1 -1
- data/app/views/leads/edit.js.haml +0 -2
- data/app/views/lists/_sidebar.html.haml +1 -1
- data/app/views/opportunities/_top_section.html.haml +2 -2
- data/app/views/opportunities/edit.js.haml +0 -1
- data/app/views/shared/_tags.html.haml +2 -1
- data/app/views/tasks/_edit.html.haml +2 -3
- data/app/views/tasks/_top_section.html.haml +1 -1
- data/app/views/users/_user.html.haml +2 -1
- data/app/views/users/opportunities_overview.html.haml +2 -2
- data/bin/bundle +3 -0
- data/bin/rails +4 -0
- data/bin/rake +4 -0
- data/config/application.rb +16 -33
- data/config/boot.rb +1 -1
- data/config/database.mysql.mac.yml +1 -0
- data/config/database.mysql.yml +1 -0
- data/config/database.postgres.docker.yml +1 -1
- data/config/database.postgres.yml +1 -0
- data/config/database.sqlite.yml +1 -0
- data/config/deploy.example.rb +3 -5
- data/config/environments/development.rb +13 -14
- data/config/environments/production.rb +8 -7
- data/config/environments/staging.rb +43 -41
- data/config/environments/test.rb +12 -14
- data/config/initializers/assets.rb +14 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/cookies_serializer.rb +3 -0
- data/config/initializers/custom_field_ransack_translations.rb +1 -1
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/mime_types.rb +0 -1
- data/config/initializers/paginate_arrays.rb +0 -1
- data/config/initializers/ransack.rb +5 -5
- data/config/initializers/session_store.rb +5 -0
- data/config/initializers/simple_form.rb +1 -1
- data/config/initializers/views.rb +33 -33
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/cz_fat_free_crm.yml +1 -1
- data/config/locales/de_fat_free_crm.yml +2 -2
- data/config/locales/en-GB_fat_free_crm.yml +2 -3
- data/config/locales/en-US_fat_free_crm.yml +2 -3
- data/config/locales/en.yml +23 -0
- data/config/locales/es-CL.yml +227 -0
- data/config/locales/es-CL_fat_free_crm.yml +929 -0
- data/config/locales/es-CL_ransack.yml +91 -0
- data/config/locales/es.yml +53 -59
- data/config/locales/es_fat_free_crm.yml +708 -370
- data/config/locales/es_ransack.yml +91 -0
- data/config/locales/fr-CA_fat_free_crm.yml +7 -7
- data/config/locales/fr_fat_free_crm.yml +285 -81
- data/config/locales/it_fat_free_crm.yml +1 -1
- data/config/locales/ja_fat_free_crm.yml +1 -1
- data/config/locales/nl.yml +210 -0
- data/config/locales/nl_fat_free_crm.yml +920 -0
- data/config/locales/nl_ransack.yml +91 -0
- data/config/locales/pl_fat_free_crm.yml +1 -1
- data/config/locales/pt-BR_fat_free_crm.yml +111 -38
- data/config/locales/ru_fat_free_crm.yml +3 -4
- data/config/locales/sv-SE_fat_free_crm.yml +1 -1
- data/config/locales/th.rb +157 -158
- data/config/locales/th_fat_free_crm.yml +1 -1
- data/config/locales/zh-CN_fat_free_crm.yml +3 -4
- data/config/routes.rb +93 -94
- data/config/unicorn.rb +25 -2
- data/custom_plan.rb +0 -2
- data/db/demo/accounts.yml +4 -5
- data/db/demo/addresses.yml +5 -5
- data/db/demo/campaigns.yml +2 -2
- data/db/demo/comments.yml +1 -1
- data/db/demo/contacts.yml +8 -8
- data/db/demo/emails.yml +5 -5
- data/db/demo/leads.yml +10 -10
- data/db/demo/opportunities.yml +2 -2
- data/db/demo/tasks.yml +2 -2
- data/db/demo/users.yml +12 -16
- data/db/migrate/20100928030598_create_sessions.rb +1 -2
- data/db/migrate/20100928030599_create_users.rb +24 -25
- data/db/migrate/20100928030600_create_openid_tables.rb +11 -12
- data/db/migrate/20100928030601_create_accounts.rb +14 -15
- data/db/migrate/20100928030602_create_permissions.rb +2 -3
- data/db/migrate/20100928030603_create_settings.rb +4 -5
- data/db/migrate/20100928030604_create_preferences.rb +3 -4
- data/db/migrate/20100928030605_create_campaigns.rb +19 -20
- data/db/migrate/20100928030606_create_leads.rb +26 -27
- data/db/migrate/20100928030607_create_contacts.rb +26 -27
- data/db/migrate/20100928030608_create_opportunities.rb +15 -16
- data/db/migrate/20100928030609_create_account_contacts.rb +2 -3
- data/db/migrate/20100928030610_create_account_opportunities.rb +2 -3
- data/db/migrate/20100928030611_create_contact_opportunities.rb +3 -4
- data/db/migrate/20100928030612_create_tasks.rb +14 -15
- data/db/migrate/20100928030613_create_comments.rb +6 -7
- data/db/migrate/20100928030614_create_activities.rb +6 -7
- data/db/migrate/20100928030615_create_avatars.rb +5 -6
- data/db/migrate/20100928030616_rename_remember_token.rb +0 -1
- data/db/migrate/20100928030617_drop_openid_tables.rb +11 -11
- data/db/migrate/20100928030618_add_admin_to_users.rb +1 -2
- data/db/migrate/20100928030619_add_suspended_to_users.rb +0 -1
- data/db/migrate/20100928030620_remove_uuid.rb +3 -3
- data/db/migrate/20100928030621_add_email_to_accounts.rb +1 -2
- data/db/migrate/20100928030622_add_background_info_to_models.rb +0 -1
- data/db/migrate/20100928030623_create_addresses.rb +14 -16
- data/db/migrate/20100928030624_add_index_on_permissions.rb +2 -3
- data/db/migrate/20100928030625_create_emails.rb +15 -16
- data/db/migrate/20100928030626_add_state_to_timeline_objects.rb +2 -3
- data/db/migrate/20100928030627_acts_as_taggable_on_migration.rb +2 -3
- data/db/migrate/20101221123456_add_single_access_token_to_users.rb +0 -1
- data/db/migrate/20101221345678_add_rating_and_category_to_accounts.rb +2 -3
- data/db/migrate/20110719082054_add_skype_to_contacts_and_leads.rb +2 -3
- data/db/migrate/20111101083437_create_fields.rb +14 -15
- data/db/migrate/20111101090312_create_field_groups.rb +4 -5
- data/db/migrate/20111116091952_add_field_groups_tag_id.rb +0 -1
- data/db/migrate/20111117041311_change_fields_collection_to_text.rb +0 -1
- data/db/migrate/20111201030535_add_field_groups_klass_name.rb +4 -4
- data/db/migrate/20120121054235_create_lists.rb +1 -1
- data/db/migrate/20120216031616_create_versions.rb +5 -5
- data/db/migrate/20120216042541_is_paranoid_to_paper_trail.rb +1 -3
- data/db/migrate/20120224073107_remove_default_value_and_clear_settings.rb +1 -1
- data/db/migrate/20120316045804_activities_to_versions.rb +6 -6
- data/db/migrate/20120405080727_change_subscribed_users_to_set.rb +5 -5
- data/db/migrate/20120405080742_change_further_subscribed_users_to_set.rb +5 -5
- data/db/migrate/20120406082136_create_groups.rb +1 -1
- data/db/migrate/20120510025219_add_not_null_constraints_for_timestamp_columns.rb +2 -1
- data/db/migrate/20120528102124_increase_length_of_version_events.rb +2 -2
- data/db/migrate/20121003063155_add_settings_to_custom_fields.rb +1 -1
- data/db/migrate/20121221033947_fix_country_mapping.rb +0 -1
- data/db/migrate/20131207033244_add_user_id_to_lists.rb +1 -1
- data/db/migrate/20141126031837_increase_email_to254_chars.rb +14 -14
- data/db/migrate/20141230021159_add_transaction_id_column_to_versions.rb +11 -0
- data/db/migrate/20141230205453_add_missing_unique_indices.acts_as_taggable_on_engine.rb +20 -0
- data/db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
- data/db/migrate/20141230205455_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
- data/db/migrate/20150123060900_convert_radio_to_radio_buttons.rb +10 -0
- data/db/migrate/20150227123054_remove_last_request_at_from_users.rb +5 -0
- data/db/migrate/20150427131956_create_index_related_type.rb +9 -0
- data/db/migrate/20160511053730_add_account_contacts_index.rb +5 -0
- data/db/schema.rb +236 -228
- data/db/seeds.rb +1 -2
- data/db/seeds/fields.rb +36 -37
- data/{fig.yml → docker-compose.yml} +0 -0
- data/fat_free_crm.gemspec +31 -18
- data/lib/development_tasks/license.rake +29 -29
- data/lib/fat_free_crm.rb +1 -5
- data/lib/fat_free_crm/callback.rb +28 -20
- data/lib/fat_free_crm/comment_extensions.rb +1 -1
- data/lib/fat_free_crm/core_ext.rb +1 -1
- data/lib/fat_free_crm/core_ext/nil.rb +0 -3
- data/lib/fat_free_crm/core_ext/string.rb +7 -21
- data/lib/fat_free_crm/custom_fields.rb +2 -2
- data/lib/fat_free_crm/engine.rb +14 -0
- data/lib/fat_free_crm/errors.rb +0 -2
- data/lib/fat_free_crm/exceptions.rb +3 -4
- data/lib/fat_free_crm/export_csv.rb +0 -2
- data/lib/fat_free_crm/exportable.rb +5 -7
- data/lib/fat_free_crm/fields.rb +7 -8
- data/lib/fat_free_crm/gem_dependencies.rb +4 -1
- data/lib/fat_free_crm/gem_ext/active_record/schema_dumper.rb +2 -2
- data/lib/fat_free_crm/gem_ext/active_support/buffered_logger.rb +0 -3
- data/lib/fat_free_crm/gem_ext/rails/engine.rb +5 -12
- data/lib/fat_free_crm/gem_ext/rake/task.rb +1 -1
- data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +1 -2
- data/lib/fat_free_crm/i18n.rb +2 -3
- data/lib/fat_free_crm/load_settings.rb +0 -2
- data/lib/fat_free_crm/mail_processor/base.rb +15 -16
- data/lib/fat_free_crm/mail_processor/comment_replies.rb +5 -10
- data/lib/fat_free_crm/mail_processor/dropbox.rb +56 -59
- data/lib/fat_free_crm/permissions.rb +18 -15
- data/lib/fat_free_crm/renderers.rb +2 -2
- data/lib/fat_free_crm/secret_token_generator.rb +3 -9
- data/lib/fat_free_crm/sortable.rb +4 -8
- data/lib/fat_free_crm/version.rb +2 -2
- data/lib/fat_free_crm/view_factory.rb +3 -8
- data/lib/gravatar_image_tag.rb +19 -24
- data/lib/missing_translation_detector.rb +10 -10
- data/lib/tasks/ffcrm/comment_replies.rake +3 -5
- data/lib/tasks/ffcrm/config.rake +3 -5
- data/lib/tasks/ffcrm/demo.rake +14 -16
- data/lib/tasks/ffcrm/dropbox.rake +3 -5
- data/lib/tasks/ffcrm/missing_translations.rake +1 -1
- data/lib/tasks/ffcrm/secret.rake +1 -3
- data/lib/tasks/ffcrm/settings.rake +2 -4
- data/lib/tasks/ffcrm/setup.rake +3 -6
- data/lib/tasks/ffcrm/update_data.rake +110 -116
- data/spec/controllers/admin/groups_controller_spec.rb +0 -1
- data/spec/controllers/admin/users_controller_spec.rb +98 -102
- data/spec/controllers/applications_controller_spec.rb +17 -21
- data/spec/controllers/authentications_controller_spec.rb +57 -61
- data/spec/controllers/comments_controller_spec.rb +32 -39
- data/spec/controllers/emails_controller_spec.rb +6 -7
- data/spec/controllers/entities/accounts_controller_spec.rb +204 -214
- data/spec/controllers/entities/campaigns_controller_spec.rb +210 -224
- data/spec/controllers/entities/contacts_controller_spec.rb +250 -270
- data/spec/controllers/entities/leads_controller_spec.rb +415 -438
- data/spec/controllers/entities/opportunities_controller_spec.rb +344 -359
- data/spec/controllers/entities_controller_spec.rb +10 -14
- data/spec/controllers/home_controller_spec.rb +85 -92
- data/spec/controllers/lists_controller_spec.rb +0 -1
- data/spec/controllers/passwords_controller_spec.rb +5 -9
- data/spec/controllers/tasks_controller_spec.rb +193 -210
- data/spec/controllers/users_controller_spec.rb +137 -146
- data/spec/factories/account_factories.rb +11 -13
- data/spec/factories/campaign_factories.rb +6 -6
- data/spec/factories/contact_factories.rb +21 -22
- data/spec/factories/field_factories.rb +8 -10
- data/spec/factories/lead_factories.rb +16 -16
- data/spec/factories/list_factories.rb +2 -2
- data/spec/factories/opportunity_factories.rb +8 -10
- data/spec/factories/sequences.rb +8 -9
- data/spec/factories/setting_factories.rb +2 -2
- data/spec/factories/shared_factories.rb +26 -30
- data/spec/factories/tag_factories.rb +1 -1
- data/spec/factories/task_factories.rb +11 -11
- data/spec/factories/user_factories.rb +22 -27
- data/spec/features/acceptance_helper.rb +1 -1
- data/spec/features/accounts_spec.rb +65 -61
- data/spec/features/admin/groups_spec.rb +11 -12
- data/spec/features/admin/users_spec.rb +17 -19
- data/spec/features/campaigns_spec.rb +61 -57
- data/spec/features/contacts_spec.rb +90 -59
- data/spec/features/dashboard_spec.rb +20 -21
- data/spec/features/leads_spec.rb +88 -67
- data/spec/features/opportunities_overview_spec.rb +31 -31
- data/spec/features/opportunities_spec.rb +64 -60
- data/spec/features/support/browser.rb +2 -2
- data/spec/features/support/headless.rb +1 -1
- data/spec/features/support/helpers.rb +5 -6
- data/spec/features/support/paths.rb +1 -2
- data/spec/features/support/selector_helpers.rb +2 -2
- data/spec/features/tasks_spec.rb +60 -54
- data/spec/helpers/accounts_helper_spec.rb +2 -5
- data/spec/helpers/admin/field_groups_helper_spec.rb +4 -4
- data/spec/helpers/admin/plugins_helper_spec.rb +0 -1
- data/spec/helpers/admin/settings_helper_spec.rb +0 -1
- data/spec/helpers/admin/users_helper_spec.rb +0 -1
- data/spec/helpers/application_helper_spec.rb +30 -33
- data/spec/helpers/authentications_helper_spec.rb +2 -5
- data/spec/helpers/campaigns_helper_spec.rb +2 -5
- data/spec/helpers/comments_helper_spec.rb +2 -5
- data/spec/helpers/contacts_helper_spec.rb +2 -5
- data/spec/helpers/emails_helper_spec.rb +0 -1
- data/spec/helpers/fields_helper_spec.rb +0 -1
- data/spec/helpers/groups_helper_spec.rb +0 -1
- data/spec/helpers/home_helper_spec.rb +2 -5
- data/spec/helpers/leads_helper_spec.rb +2 -5
- data/spec/helpers/lists_helper_spec.rb +0 -1
- data/spec/helpers/opportunities_helper_spec.rb +2 -5
- data/spec/helpers/passwords_helper_spec.rb +2 -5
- data/spec/helpers/tasks_helper_spec.rb +1 -5
- data/spec/helpers/users_helper_spec.rb +9 -11
- data/spec/lib/comment_extensions_spec.rb +3 -3
- data/spec/lib/core_ext/string_spec.rb +1 -1
- data/spec/lib/errors_spec.rb +10 -10
- data/spec/lib/fields_spec.rb +23 -33
- data/spec/lib/mail_processor/base_spec.rb +41 -43
- data/spec/lib/mail_processor/comment_replies_spec.rb +17 -17
- data/spec/lib/mail_processor/dropbox_spec.rb +91 -95
- data/spec/lib/mail_processor/sample_emails/dropbox.rb +13 -14
- data/spec/lib/permissions_spec.rb +44 -47
- data/spec/lib/secret_token_generator_spec.rb +16 -28
- data/spec/lib/view_factory_spec.rb +18 -24
- data/spec/mailers/subscription_mailer_spec.rb +14 -16
- data/spec/mailers/user_mailer_spec.rb +33 -34
- data/spec/models/entities/account_contact_spec.rb +2 -3
- data/spec/models/entities/account_opportunity_spec.rb +2 -3
- data/spec/models/entities/account_spec.rb +52 -59
- data/spec/models/entities/campaign_spec.rb +32 -39
- data/spec/models/entities/contact_opportunity_spec.rb +2 -3
- data/spec/models/entities/contact_spec.rb +71 -72
- data/spec/models/entities/lead_spec.rb +15 -22
- data/spec/models/entities/opportunity_spec.rb +104 -103
- data/spec/models/fields/custom_field_date_pair_spec.rb +38 -44
- data/spec/models/fields/custom_field_pair_spec.rb +28 -36
- data/spec/models/fields/custom_field_spec.rb +50 -56
- data/spec/models/fields/field_group_spec.rb +1 -2
- data/spec/models/fields/field_spec.rb +13 -15
- data/spec/models/list_spec.rb +4 -4
- data/spec/models/observers/entity_observer_spec.rb +18 -21
- data/spec/models/polymorphic/address_spec.rb +1 -3
- data/spec/models/polymorphic/avatar_spec.rb +6 -8
- data/spec/models/polymorphic/comment_spec.rb +7 -9
- data/spec/models/polymorphic/email_spec.rb +1 -2
- data/spec/models/polymorphic/task_spec.rb +130 -142
- data/spec/models/polymorphic/version_spec.rb +84 -91
- data/spec/models/setting_spec.rb +17 -19
- data/spec/models/users/abilities/user_ability_spec.rb +25 -20
- data/spec/models/users/authentication_spec.rb +0 -1
- data/spec/models/users/group_spec.rb +0 -1
- data/spec/models/users/permission_spec.rb +12 -13
- data/spec/models/users/preference_spec.rb +15 -15
- data/spec/models/users/user_spec.rb +53 -55
- data/spec/routing/accounts_routing_spec.rb +12 -14
- data/spec/routing/admin/users_routing_spec.rb +7 -9
- data/spec/routing/campaigns_routing_spec.rb +13 -14
- data/spec/routing/comments_routing_spec.rb +5 -6
- data/spec/routing/contacts_routing_spec.rb +12 -14
- data/spec/routing/emails_routing_spec.rb +7 -8
- data/spec/routing/leads_routing_spec.rb +19 -21
- data/spec/routing/opportunities_routing_spec.rb +13 -15
- data/spec/routing/tasks_routing_spec.rb +14 -15
- data/spec/routing/users_routing_spec.rb +18 -19
- data/spec/shared/controllers.rb +35 -35
- data/spec/shared/models.rb +52 -55
- data/spec/spec_helper.rb +21 -42
- data/spec/support/assert_select.rb +19 -18
- data/spec/support/auth_macros.rb +3 -3
- data/spec/support/macros.rb +5 -6
- data/spec/support/mail_processor_mocks.rb +11 -11
- data/spec/views/accounts/_edit.haml_spec.rb +9 -9
- data/spec/views/accounts/_new.haml_spec.rb +8 -9
- data/spec/views/accounts/create.js.haml_spec.rb +11 -12
- data/spec/views/accounts/destroy.js.haml_spec.rb +6 -7
- data/spec/views/accounts/edit.js.haml_spec.rb +12 -13
- data/spec/views/accounts/index.haml_spec.rb +8 -8
- data/spec/views/accounts/index.js.haml_spec.rb +7 -8
- data/spec/views/accounts/new.js.haml_spec.rb +7 -8
- data/spec/views/accounts/show.haml_spec.rb +11 -12
- data/spec/views/accounts/update.js.haml_spec.rb +18 -18
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +8 -10
- data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +7 -9
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +5 -7
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +6 -8
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +7 -9
- data/spec/views/admin/users/_create.haml_spec.rb +4 -4
- data/spec/views/admin/users/create.js.haml_spec.rb +8 -9
- data/spec/views/admin/users/destroy.js.haml_spec.rb +6 -6
- data/spec/views/admin/users/edit.js.haml_spec.rb +7 -9
- data/spec/views/admin/users/index.haml_spec.rb +4 -5
- data/spec/views/admin/users/index.js.haml_spec.rb +6 -8
- data/spec/views/admin/users/new.js.haml_spec.rb +4 -6
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +4 -4
- data/spec/views/admin/users/show.haml_spec.rb +0 -1
- data/spec/views/admin/users/suspend.js.haml_spec.rb +4 -4
- data/spec/views/admin/users/update.js.haml_spec.rb +6 -7
- data/spec/views/application/auto_complete.haml_spec.rb +12 -14
- data/spec/views/authentications/new.haml_spec.rb +6 -7
- data/spec/views/campaigns/_edit.haml_spec.rb +9 -9
- data/spec/views/campaigns/_new.haml_spec.rb +8 -8
- data/spec/views/campaigns/create.js.haml_spec.rb +11 -12
- data/spec/views/campaigns/destroy.js.haml_spec.rb +7 -8
- data/spec/views/campaigns/edit.js.haml_spec.rb +12 -20
- data/spec/views/campaigns/index.haml_spec.rb +6 -7
- data/spec/views/campaigns/index.js.haml_spec.rb +9 -10
- data/spec/views/campaigns/new.js.haml_spec.rb +7 -8
- data/spec/views/campaigns/show.haml_spec.rb +12 -13
- data/spec/views/campaigns/update.js.haml_spec.rb +16 -16
- data/spec/views/comments/edit.js.haml_spec.rb +7 -7
- data/spec/views/contacts/_edit.haml_spec.rb +21 -21
- data/spec/views/contacts/_new.haml_spec.rb +12 -13
- data/spec/views/contacts/create.js.haml_spec.rb +12 -13
- data/spec/views/contacts/destroy.js.haml_spec.rb +6 -7
- data/spec/views/contacts/edit.js.haml_spec.rb +15 -17
- data/spec/views/contacts/index.haml_spec.rb +6 -7
- data/spec/views/contacts/index.js.html_spec.rb +7 -8
- data/spec/views/contacts/new.js.haml_spec.rb +8 -9
- data/spec/views/contacts/show.haml_spec.rb +9 -10
- data/spec/views/contacts/update.js.haml_spec.rb +26 -26
- data/spec/views/home/index.haml_spec.rb +4 -5
- data/spec/views/home/index.js.haml_spec.rb +6 -7
- data/spec/views/home/options.js.haml_spec.rb +10 -10
- data/spec/views/leads/_convert.haml_spec.rb +5 -6
- data/spec/views/leads/_edit.haml_spec.rb +13 -13
- data/spec/views/leads/_new.haml_spec.rb +11 -11
- data/spec/views/leads/_sidebar_show.haml_spec.rb +9 -9
- data/spec/views/leads/convert.js.haml_spec.rb +16 -17
- data/spec/views/leads/create.js.haml_spec.rb +16 -17
- data/spec/views/leads/destroy.js.haml_spec.rb +10 -11
- data/spec/views/leads/edit.js.haml_spec.rb +16 -17
- data/spec/views/leads/index.haml_spec.rb +7 -8
- data/spec/views/leads/index.js.haml_spec.rb +10 -11
- data/spec/views/leads/new.js.haml_spec.rb +8 -9
- data/spec/views/leads/promote.js.haml_spec.rb +30 -31
- data/spec/views/leads/reject.js.haml_spec.rb +10 -11
- data/spec/views/leads/show.haml_spec.rb +7 -8
- data/spec/views/leads/update.js.haml_spec.rb +28 -29
- data/spec/views/opportunities/_edit.haml_spec.rb +19 -19
- data/spec/views/opportunities/_new.haml_spec.rb +10 -10
- data/spec/views/opportunities/create.js.haml_spec.rb +19 -20
- data/spec/views/opportunities/destroy.js.haml_spec.rb +14 -15
- data/spec/views/opportunities/edit.js.haml_spec.rb +14 -16
- data/spec/views/opportunities/index.haml_spec.rb +6 -7
- data/spec/views/opportunities/index.js.haml_spec.rb +7 -8
- data/spec/views/opportunities/new.js.haml_spec.rb +8 -9
- data/spec/views/opportunities/show.haml_spec.rb +9 -10
- data/spec/views/opportunities/update.js.haml_spec.rb +35 -35
- data/spec/views/tasks/_edit.haml_spec.rb +9 -9
- data/spec/views/tasks/complete.js.haml_spec.rb +11 -12
- data/spec/views/tasks/create.js.haml_spec.rb +29 -31
- data/spec/views/tasks/destroy.js.haml_spec.rb +8 -8
- data/spec/views/tasks/edit.js.haml_spec.rb +12 -15
- data/spec/views/tasks/index.haml_spec.rb +7 -7
- data/spec/views/tasks/new.js.haml_spec.rb +7 -8
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +6 -6
- data/spec/views/tasks/update.js.haml_spec.rb +41 -44
- data/spec/views/users/avatar.js.haml_spec.rb +7 -8
- data/spec/views/users/change_password.js.haml_spec.rb +9 -10
- data/spec/views/users/edit.js.haml_spec.rb +7 -8
- data/spec/views/users/password.js.haml_spec.rb +8 -9
- data/spec/views/users/update.js.haml_spec.rb +6 -7
- data/spec/views/users/upload_avatar.js.haml_spec.rb +9 -9
- data/vendor/assets/javascripts/jquery_timeago/index.js +2 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.es-CL.js +18 -0
- data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.nl.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery-ui-timepicker-es-CL.js +20 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-es-CL.js +23 -0
- data/vendor/assets/javascripts/jquery_ui_datepicker/jquery.ui.datepicker-nl.js +21 -0
- data/vendor/assets/stylesheets/{jquery-ui.custom.css → jquery-ui.custom.scss} +52 -51
- data/vendor/gems/globby-0.1.2/LICENSE.txt +20 -0
- data/vendor/gems/globby-0.1.2/README.md +65 -0
- data/vendor/gems/globby-0.1.2/Rakefile +9 -0
- data/vendor/gems/globby-0.1.2/lib/globby.rb +47 -0
- data/vendor/gems/globby-0.1.2/lib/globby/glob.rb +90 -0
- data/vendor/gems/globby-0.1.2/lib/globby/globject.rb +18 -0
- data/vendor/gems/globby-0.1.2/lib/globby/result.rb +20 -0
- data/vendor/gems/globby-0.1.2/spec/gitignore_spec.rb +109 -0
- data/vendor/gems/globby-0.1.2/spec/globby_spec.rb +93 -0
- metadata +177 -55
- data/Gemfile.ci +0 -13
- data/config/initializers/sass.rb +0 -18
- data/lib/country_select.rb +0 -570
- data/lib/fat_free_crm/plugin.rb +0 -94
@@ -17,14 +17,14 @@ class ActivitiesToVersions < ActiveRecord::Migration
|
|
17
17
|
# commented and email activities don't translate well so ignore them
|
18
18
|
if event = events[activity['action']]
|
19
19
|
attributes = {
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
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
25
|
}
|
26
26
|
version = Version.new
|
27
|
-
attributes.each {|k, v| version.send("#{k}=", v)}
|
27
|
+
attributes.each { |k, v| version.send("#{k}=", v) }
|
28
28
|
version.save!
|
29
29
|
end
|
30
30
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
class ChangeSubscribedUsersToSet < ActiveRecord::Migration
|
2
2
|
def up
|
3
|
-
contacts = connection.select_all %
|
3
|
+
contacts = connection.select_all %(
|
4
4
|
SELECT id, subscribed_users
|
5
5
|
FROM contacts
|
6
6
|
WHERE subscribed_users IS NOT NULL
|
7
|
-
|
7
|
+
)
|
8
8
|
|
9
9
|
puts "Converting #{contacts.size} subscribed_users arrays into sets..." unless contacts.empty?
|
10
10
|
|
@@ -13,11 +13,11 @@ class ChangeSubscribedUsersToSet < ActiveRecord::Migration
|
|
13
13
|
contacts.each do |contact|
|
14
14
|
subscribed_users_set = Set.new(YAML.load(contact["subscribed_users"]))
|
15
15
|
|
16
|
-
connection.execute %
|
16
|
+
connection.execute %(
|
17
17
|
UPDATE contacts
|
18
18
|
SET subscribed_users = '#{subscribed_users_set.to_yaml}'
|
19
|
-
WHERE id = #{contact[
|
20
|
-
|
19
|
+
WHERE id = #{contact['id']}
|
20
|
+
)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -2,11 +2,11 @@ class ChangeFurtherSubscribedUsersToSet < ActiveRecord::Migration
|
|
2
2
|
def up
|
3
3
|
# Change the other tables that were missing from the previous migration
|
4
4
|
%w(campaigns opportunities leads tasks accounts).each do |table|
|
5
|
-
entities = connection.select_all %
|
5
|
+
entities = connection.select_all %(
|
6
6
|
SELECT id, subscribed_users
|
7
7
|
FROM #{table}
|
8
8
|
WHERE subscribed_users IS NOT NULL
|
9
|
-
|
9
|
+
)
|
10
10
|
|
11
11
|
puts "#{table}: Converting #{entities.size} subscribed_users arrays into sets..." unless entities.empty?
|
12
12
|
|
@@ -15,11 +15,11 @@ class ChangeFurtherSubscribedUsersToSet < ActiveRecord::Migration
|
|
15
15
|
entities.each do |entity|
|
16
16
|
subscribed_users_set = Set.new(YAML.load(entity["subscribed_users"]))
|
17
17
|
|
18
|
-
connection.execute %
|
18
|
+
connection.execute %(
|
19
19
|
UPDATE #{table}
|
20
20
|
SET subscribed_users = '#{subscribed_users_set.to_yaml}'
|
21
|
-
WHERE id = #{entity[
|
22
|
-
|
21
|
+
WHERE id = #{entity['id']}
|
22
|
+
)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -8,7 +8,7 @@ class CreateGroups < ActiveRecord::Migration
|
|
8
8
|
add_column :permissions, :group_id, :integer
|
9
9
|
add_index :permissions, :group_id
|
10
10
|
|
11
|
-
create_table :groups_users, :
|
11
|
+
create_table :groups_users, id: false do |t|
|
12
12
|
t.references :group
|
13
13
|
t.references :user
|
14
14
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class AddNotNullConstraintsForTimestampColumns < ActiveRecord::Migration
|
2
2
|
def up
|
3
|
-
set_timestamp_constraints :
|
3
|
+
set_timestamp_constraints null: false unless $FFCRM_NEW_DATABASE
|
4
4
|
end
|
5
5
|
|
6
6
|
def down
|
@@ -8,6 +8,7 @@ class AddNotNullConstraintsForTimestampColumns < ActiveRecord::Migration
|
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
11
|
+
|
11
12
|
def set_timestamp_constraints(constraints)
|
12
13
|
ActiveRecord::Base.connection.tables.each do |table|
|
13
14
|
# If table has both timestamp columns, set not null constraints on both columns.
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class IncreaseLengthOfVersionEvents < ActiveRecord::Migration
|
2
2
|
def up
|
3
|
-
change_column :versions, :event, :string, :
|
3
|
+
change_column :versions, :event, :string, limit: 512
|
4
4
|
end
|
5
5
|
|
6
6
|
def down
|
7
|
-
change_column :versions, :event, :string, :
|
7
|
+
change_column :versions, :event, :string, limit: 255
|
8
8
|
end
|
9
9
|
end
|
@@ -1,21 +1,21 @@
|
|
1
1
|
class IncreaseEmailTo254Chars < ActiveRecord::Migration
|
2
2
|
def up
|
3
|
-
change_column :accounts, :email, :string, :
|
4
|
-
change_column :contacts, :email, :string, :
|
5
|
-
change_column :contacts, :alt_email, :string, :
|
6
|
-
change_column :leads, :email, :string, :
|
7
|
-
change_column :leads, :alt_email, :string, :
|
8
|
-
change_column :users, :email, :string, :
|
9
|
-
change_column :users, :alt_email, :string, :
|
3
|
+
change_column :accounts, :email, :string, limit: 254
|
4
|
+
change_column :contacts, :email, :string, limit: 254
|
5
|
+
change_column :contacts, :alt_email, :string, limit: 254
|
6
|
+
change_column :leads, :email, :string, limit: 254
|
7
|
+
change_column :leads, :alt_email, :string, limit: 254
|
8
|
+
change_column :users, :email, :string, limit: 254
|
9
|
+
change_column :users, :alt_email, :string, limit: 254
|
10
10
|
end
|
11
11
|
|
12
12
|
def down
|
13
|
-
change_column :accounts, :email, :string, :
|
14
|
-
change_column :contacts, :email, :string, :
|
15
|
-
change_column :contacts, :alt_email, :string, :
|
16
|
-
change_column :leads, :email, :string, :
|
17
|
-
change_column :leads, :alt_email, :string, :
|
18
|
-
change_column :users, :email, :string, :
|
19
|
-
change_column :users, :alt_email, :string, :
|
13
|
+
change_column :accounts, :email, :string, limit: 64
|
14
|
+
change_column :contacts, :email, :string, limit: 64
|
15
|
+
change_column :contacts, :alt_email, :string, limit: 64
|
16
|
+
change_column :leads, :email, :string, limit: 64
|
17
|
+
change_column :leads, :alt_email, :string, limit: 64
|
18
|
+
change_column :users, :email, :string, limit: 64
|
19
|
+
change_column :users, :alt_email, :string, limit: 64
|
20
20
|
end
|
21
21
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class AddTransactionIdColumnToVersions < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :versions, :transaction_id, :integer
|
4
|
+
add_index :versions, [:transaction_id]
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_index :versions, [:transaction_id]
|
9
|
+
remove_column :versions, :transaction_id
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 2)
|
2
|
+
class AddMissingUniqueIndices < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_index :tags, :name, unique: true
|
5
|
+
|
6
|
+
remove_index :taggings, :tag_id
|
7
|
+
remove_index :taggings, [:taggable_id, :taggable_type, :context]
|
8
|
+
add_index :taggings,
|
9
|
+
[:tag_id, :taggable_id, :taggable_type, :context],
|
10
|
+
unique: true, name: 'taggings_idx'
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
remove_index :tags, :name
|
15
|
+
|
16
|
+
remove_index :taggings, name: 'taggings_idx'
|
17
|
+
add_index :taggings, :tag_id
|
18
|
+
add_index :taggings, [:taggable_id, :taggable_type, :context]
|
19
|
+
end
|
20
|
+
end
|
data/db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 3)
|
2
|
+
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_column :tags, :taggings_count, :integer, default: 0
|
5
|
+
|
6
|
+
ActsAsTaggableOn::Tag.reset_column_information
|
7
|
+
ActsAsTaggableOn::Tag.find_each do |tag|
|
8
|
+
ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
remove_column :tags, :taggings_count
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 4)
|
2
|
+
class AddMissingTaggableIndex < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_index :taggings, [:taggable_id, :taggable_type, :context]
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_index :taggings, [:taggable_id, :taggable_type, :context]
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class ConvertRadioToRadioButtons < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
# UPDATE "fields" SET "as" = 'radio_buttons' WHERE "fields"."as" = $1 [["as", "radio"]]
|
4
|
+
Field.where(as: 'radio').update_all(as: 'radio_buttons')
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
Field.where(as: 'radio_buttons').update_all(as: 'radio')
|
9
|
+
end
|
10
|
+
end
|
data/db/schema.rb
CHANGED
@@ -9,182 +9,187 @@
|
|
9
9
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
10
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
11
|
#
|
12
|
-
# It's strongly recommended
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:
|
14
|
+
ActiveRecord::Schema.define(version: 20160511053730) do
|
15
15
|
|
16
|
-
|
16
|
+
# These are extensions that must be enabled in order to support this database
|
17
|
+
enable_extension "plpgsql"
|
18
|
+
|
19
|
+
create_table "account_contacts", force: :cascade do |t|
|
17
20
|
t.integer "account_id"
|
18
21
|
t.integer "contact_id"
|
19
22
|
t.datetime "deleted_at"
|
20
|
-
t.datetime "created_at"
|
21
|
-
t.datetime "updated_at"
|
23
|
+
t.datetime "created_at"
|
24
|
+
t.datetime "updated_at"
|
22
25
|
end
|
23
26
|
|
24
|
-
|
27
|
+
add_index "account_contacts", ["account_id", "contact_id"], name: "index_account_contacts_on_account_id_and_contact_id", using: :btree
|
28
|
+
|
29
|
+
create_table "account_opportunities", force: :cascade do |t|
|
25
30
|
t.integer "account_id"
|
26
31
|
t.integer "opportunity_id"
|
27
32
|
t.datetime "deleted_at"
|
28
|
-
t.datetime "created_at"
|
29
|
-
t.datetime "updated_at"
|
33
|
+
t.datetime "created_at"
|
34
|
+
t.datetime "updated_at"
|
30
35
|
end
|
31
36
|
|
32
|
-
add_index "account_opportunities", ["account_id", "opportunity_id"], :
|
37
|
+
add_index "account_opportunities", ["account_id", "opportunity_id"], name: "index_account_opportunities_on_account_id_and_opportunity_id", using: :btree
|
33
38
|
|
34
|
-
create_table "accounts", :
|
39
|
+
create_table "accounts", force: :cascade do |t|
|
35
40
|
t.integer "user_id"
|
36
41
|
t.integer "assigned_to"
|
37
|
-
t.string "name", :
|
38
|
-
t.string "access", :
|
39
|
-
t.string "website", :
|
40
|
-
t.string "toll_free_phone", :
|
41
|
-
t.string "phone", :
|
42
|
-
t.string "fax", :
|
42
|
+
t.string "name", limit: 64, default: "", null: false
|
43
|
+
t.string "access", limit: 8, default: "Public"
|
44
|
+
t.string "website", limit: 64
|
45
|
+
t.string "toll_free_phone", limit: 32
|
46
|
+
t.string "phone", limit: 32
|
47
|
+
t.string "fax", limit: 32
|
43
48
|
t.datetime "deleted_at"
|
44
|
-
t.datetime "created_at"
|
45
|
-
t.datetime "updated_at"
|
46
|
-
t.string "email", :
|
49
|
+
t.datetime "created_at"
|
50
|
+
t.datetime "updated_at"
|
51
|
+
t.string "email", limit: 254
|
47
52
|
t.string "background_info"
|
48
|
-
t.integer "rating",
|
49
|
-
t.string "category", :
|
53
|
+
t.integer "rating", default: 0, null: false
|
54
|
+
t.string "category", limit: 32
|
50
55
|
t.text "subscribed_users"
|
51
56
|
end
|
52
57
|
|
53
|
-
add_index "accounts", ["assigned_to"], :
|
54
|
-
add_index "accounts", ["user_id", "name", "deleted_at"], :
|
58
|
+
add_index "accounts", ["assigned_to"], name: "index_accounts_on_assigned_to", using: :btree
|
59
|
+
add_index "accounts", ["user_id", "name", "deleted_at"], name: "index_accounts_on_user_id_and_name_and_deleted_at", unique: true, using: :btree
|
55
60
|
|
56
|
-
create_table "activities", :
|
61
|
+
create_table "activities", force: :cascade do |t|
|
57
62
|
t.integer "user_id"
|
58
63
|
t.integer "subject_id"
|
59
64
|
t.string "subject_type"
|
60
|
-
t.string "action", :
|
61
|
-
t.string "info",
|
62
|
-
t.boolean "private",
|
63
|
-
t.datetime "created_at"
|
64
|
-
t.datetime "updated_at"
|
65
|
+
t.string "action", limit: 32, default: "created"
|
66
|
+
t.string "info", default: ""
|
67
|
+
t.boolean "private", default: false
|
68
|
+
t.datetime "created_at"
|
69
|
+
t.datetime "updated_at"
|
65
70
|
end
|
66
71
|
|
67
|
-
add_index "activities", ["created_at"], :
|
68
|
-
add_index "activities", ["user_id"], :
|
72
|
+
add_index "activities", ["created_at"], name: "index_activities_on_created_at", using: :btree
|
73
|
+
add_index "activities", ["user_id"], name: "index_activities_on_user_id", using: :btree
|
69
74
|
|
70
|
-
create_table "addresses", :
|
75
|
+
create_table "addresses", force: :cascade do |t|
|
71
76
|
t.string "street1"
|
72
77
|
t.string "street2"
|
73
|
-
t.string "city", :
|
74
|
-
t.string "state", :
|
75
|
-
t.string "zipcode", :
|
76
|
-
t.string "country", :
|
78
|
+
t.string "city", limit: 64
|
79
|
+
t.string "state", limit: 64
|
80
|
+
t.string "zipcode", limit: 16
|
81
|
+
t.string "country", limit: 64
|
77
82
|
t.string "full_address"
|
78
|
-
t.string "address_type", :
|
83
|
+
t.string "address_type", limit: 16
|
79
84
|
t.integer "addressable_id"
|
80
85
|
t.string "addressable_type"
|
81
|
-
t.datetime "created_at"
|
82
|
-
t.datetime "updated_at"
|
86
|
+
t.datetime "created_at"
|
87
|
+
t.datetime "updated_at"
|
83
88
|
t.datetime "deleted_at"
|
84
89
|
end
|
85
90
|
|
86
|
-
add_index "addresses", ["addressable_id", "addressable_type"], :
|
91
|
+
add_index "addresses", ["addressable_id", "addressable_type"], name: "index_addresses_on_addressable_id_and_addressable_type", using: :btree
|
87
92
|
|
88
|
-
create_table "avatars", :
|
93
|
+
create_table "avatars", force: :cascade do |t|
|
89
94
|
t.integer "user_id"
|
90
95
|
t.integer "entity_id"
|
91
96
|
t.string "entity_type"
|
92
97
|
t.integer "image_file_size"
|
93
98
|
t.string "image_file_name"
|
94
99
|
t.string "image_content_type"
|
95
|
-
t.datetime "created_at"
|
96
|
-
t.datetime "updated_at"
|
100
|
+
t.datetime "created_at"
|
101
|
+
t.datetime "updated_at"
|
97
102
|
end
|
98
103
|
|
99
|
-
create_table "campaigns", :
|
104
|
+
create_table "campaigns", force: :cascade do |t|
|
100
105
|
t.integer "user_id"
|
101
106
|
t.integer "assigned_to"
|
102
|
-
t.string "name", :
|
103
|
-
t.string "access", :
|
104
|
-
t.string "status", :
|
105
|
-
t.decimal "budget",
|
107
|
+
t.string "name", limit: 64, default: "", null: false
|
108
|
+
t.string "access", limit: 8, default: "Public"
|
109
|
+
t.string "status", limit: 64
|
110
|
+
t.decimal "budget", precision: 12, scale: 2
|
106
111
|
t.integer "target_leads"
|
107
112
|
t.float "target_conversion"
|
108
|
-
t.decimal "target_revenue",
|
113
|
+
t.decimal "target_revenue", precision: 12, scale: 2
|
109
114
|
t.integer "leads_count"
|
110
115
|
t.integer "opportunities_count"
|
111
|
-
t.decimal "revenue",
|
116
|
+
t.decimal "revenue", precision: 12, scale: 2
|
112
117
|
t.date "starts_on"
|
113
118
|
t.date "ends_on"
|
114
119
|
t.text "objectives"
|
115
120
|
t.datetime "deleted_at"
|
116
|
-
t.datetime "created_at"
|
117
|
-
t.datetime "updated_at"
|
121
|
+
t.datetime "created_at"
|
122
|
+
t.datetime "updated_at"
|
118
123
|
t.string "background_info"
|
119
124
|
t.text "subscribed_users"
|
120
125
|
end
|
121
126
|
|
122
|
-
add_index "campaigns", ["assigned_to"], :
|
123
|
-
add_index "campaigns", ["user_id", "name", "deleted_at"], :
|
127
|
+
add_index "campaigns", ["assigned_to"], name: "index_campaigns_on_assigned_to", using: :btree
|
128
|
+
add_index "campaigns", ["user_id", "name", "deleted_at"], name: "index_campaigns_on_user_id_and_name_and_deleted_at", unique: true, using: :btree
|
124
129
|
|
125
|
-
create_table "comments", :
|
130
|
+
create_table "comments", force: :cascade do |t|
|
126
131
|
t.integer "user_id"
|
127
132
|
t.integer "commentable_id"
|
128
133
|
t.string "commentable_type"
|
129
134
|
t.boolean "private"
|
130
|
-
t.string "title",
|
135
|
+
t.string "title", default: ""
|
131
136
|
t.text "comment"
|
132
|
-
t.datetime "created_at"
|
133
|
-
t.datetime "updated_at"
|
134
|
-
t.string "state", :
|
137
|
+
t.datetime "created_at"
|
138
|
+
t.datetime "updated_at"
|
139
|
+
t.string "state", limit: 16, default: "Expanded", null: false
|
135
140
|
end
|
136
141
|
|
137
|
-
create_table "contact_opportunities", :
|
142
|
+
create_table "contact_opportunities", force: :cascade do |t|
|
138
143
|
t.integer "contact_id"
|
139
144
|
t.integer "opportunity_id"
|
140
|
-
t.string "role", :
|
145
|
+
t.string "role", limit: 32
|
141
146
|
t.datetime "deleted_at"
|
142
|
-
t.datetime "created_at"
|
143
|
-
t.datetime "updated_at"
|
147
|
+
t.datetime "created_at"
|
148
|
+
t.datetime "updated_at"
|
144
149
|
end
|
145
150
|
|
146
|
-
add_index "contact_opportunities", ["contact_id", "opportunity_id"], :
|
151
|
+
add_index "contact_opportunities", ["contact_id", "opportunity_id"], name: "index_contact_opportunities_on_contact_id_and_opportunity_id", using: :btree
|
147
152
|
|
148
|
-
create_table "contacts", :
|
153
|
+
create_table "contacts", force: :cascade do |t|
|
149
154
|
t.integer "user_id"
|
150
155
|
t.integer "lead_id"
|
151
156
|
t.integer "assigned_to"
|
152
157
|
t.integer "reports_to"
|
153
|
-
t.string "first_name", :
|
154
|
-
t.string "last_name", :
|
155
|
-
t.string "access", :
|
156
|
-
t.string "title", :
|
157
|
-
t.string "department", :
|
158
|
-
t.string "source", :
|
159
|
-
t.string "email", :
|
160
|
-
t.string "alt_email", :
|
161
|
-
t.string "phone", :
|
162
|
-
t.string "mobile", :
|
163
|
-
t.string "fax", :
|
164
|
-
t.string "blog", :
|
165
|
-
t.string "linkedin", :
|
166
|
-
t.string "facebook", :
|
167
|
-
t.string "twitter", :
|
158
|
+
t.string "first_name", limit: 64, default: "", null: false
|
159
|
+
t.string "last_name", limit: 64, default: "", null: false
|
160
|
+
t.string "access", limit: 8, default: "Public"
|
161
|
+
t.string "title", limit: 64
|
162
|
+
t.string "department", limit: 64
|
163
|
+
t.string "source", limit: 32
|
164
|
+
t.string "email", limit: 254
|
165
|
+
t.string "alt_email", limit: 254
|
166
|
+
t.string "phone", limit: 32
|
167
|
+
t.string "mobile", limit: 32
|
168
|
+
t.string "fax", limit: 32
|
169
|
+
t.string "blog", limit: 128
|
170
|
+
t.string "linkedin", limit: 128
|
171
|
+
t.string "facebook", limit: 128
|
172
|
+
t.string "twitter", limit: 128
|
168
173
|
t.date "born_on"
|
169
|
-
t.boolean "do_not_call",
|
174
|
+
t.boolean "do_not_call", default: false, null: false
|
170
175
|
t.datetime "deleted_at"
|
171
|
-
t.datetime "created_at"
|
172
|
-
t.datetime "updated_at"
|
176
|
+
t.datetime "created_at"
|
177
|
+
t.datetime "updated_at"
|
173
178
|
t.string "background_info"
|
174
|
-
t.string "skype", :
|
179
|
+
t.string "skype", limit: 128
|
175
180
|
t.text "subscribed_users"
|
176
181
|
end
|
177
182
|
|
178
|
-
add_index "contacts", ["assigned_to"], :
|
179
|
-
add_index "contacts", ["user_id", "last_name", "deleted_at"], :
|
183
|
+
add_index "contacts", ["assigned_to"], name: "index_contacts_on_assigned_to", using: :btree
|
184
|
+
add_index "contacts", ["user_id", "last_name", "deleted_at"], name: "id_last_name_deleted", unique: true, using: :btree
|
180
185
|
|
181
|
-
create_table "emails", :
|
182
|
-
t.string "imap_message_id",
|
186
|
+
create_table "emails", force: :cascade do |t|
|
187
|
+
t.string "imap_message_id", null: false
|
183
188
|
t.integer "user_id"
|
184
189
|
t.integer "mediator_id"
|
185
190
|
t.string "mediator_type"
|
186
|
-
t.string "sent_from",
|
187
|
-
t.string "sent_to",
|
191
|
+
t.string "sent_from", null: false
|
192
|
+
t.string "sent_to", null: false
|
188
193
|
t.string "cc"
|
189
194
|
t.string "bcc"
|
190
195
|
t.string "subject"
|
@@ -193,259 +198,262 @@ ActiveRecord::Schema.define(:version => 20141126031837) do
|
|
193
198
|
t.datetime "sent_at"
|
194
199
|
t.datetime "received_at"
|
195
200
|
t.datetime "deleted_at"
|
196
|
-
t.datetime "created_at"
|
197
|
-
t.datetime "updated_at"
|
198
|
-
t.string "state", :
|
201
|
+
t.datetime "created_at"
|
202
|
+
t.datetime "updated_at"
|
203
|
+
t.string "state", limit: 16, default: "Expanded", null: false
|
199
204
|
end
|
200
205
|
|
201
|
-
add_index "emails", ["mediator_id", "mediator_type"], :
|
206
|
+
add_index "emails", ["mediator_id", "mediator_type"], name: "index_emails_on_mediator_id_and_mediator_type", using: :btree
|
202
207
|
|
203
|
-
create_table "field_groups", :
|
204
|
-
t.string "name", :
|
205
|
-
t.string "label", :
|
208
|
+
create_table "field_groups", force: :cascade do |t|
|
209
|
+
t.string "name", limit: 64
|
210
|
+
t.string "label", limit: 128
|
206
211
|
t.integer "position"
|
207
212
|
t.string "hint"
|
208
|
-
t.datetime "created_at"
|
209
|
-
t.datetime "updated_at"
|
213
|
+
t.datetime "created_at"
|
214
|
+
t.datetime "updated_at"
|
210
215
|
t.integer "tag_id"
|
211
|
-
t.string "klass_name", :
|
216
|
+
t.string "klass_name", limit: 32
|
212
217
|
end
|
213
218
|
|
214
|
-
create_table "fields", :
|
219
|
+
create_table "fields", force: :cascade do |t|
|
215
220
|
t.string "type"
|
216
221
|
t.integer "field_group_id"
|
217
222
|
t.integer "position"
|
218
|
-
t.string "name", :
|
219
|
-
t.string "label", :
|
223
|
+
t.string "name", limit: 64
|
224
|
+
t.string "label", limit: 128
|
220
225
|
t.string "hint"
|
221
226
|
t.string "placeholder"
|
222
|
-
t.string "as", :
|
227
|
+
t.string "as", limit: 32
|
223
228
|
t.text "collection"
|
224
229
|
t.boolean "disabled"
|
225
230
|
t.boolean "required"
|
226
231
|
t.integer "maxlength"
|
227
|
-
t.datetime "created_at"
|
228
|
-
t.datetime "updated_at"
|
232
|
+
t.datetime "created_at"
|
233
|
+
t.datetime "updated_at"
|
229
234
|
t.integer "pair_id"
|
230
235
|
t.text "settings"
|
231
236
|
end
|
232
237
|
|
233
|
-
add_index "fields", ["field_group_id"], :
|
234
|
-
add_index "fields", ["name"], :
|
238
|
+
add_index "fields", ["field_group_id"], name: "index_fields_on_field_group_id", using: :btree
|
239
|
+
add_index "fields", ["name"], name: "index_fields_on_name", using: :btree
|
235
240
|
|
236
|
-
create_table "groups", :
|
241
|
+
create_table "groups", force: :cascade do |t|
|
237
242
|
t.string "name"
|
238
|
-
t.datetime "created_at"
|
239
|
-
t.datetime "updated_at"
|
243
|
+
t.datetime "created_at"
|
244
|
+
t.datetime "updated_at"
|
240
245
|
end
|
241
246
|
|
242
|
-
create_table "groups_users", :
|
247
|
+
create_table "groups_users", id: false, force: :cascade do |t|
|
243
248
|
t.integer "group_id"
|
244
249
|
t.integer "user_id"
|
245
250
|
end
|
246
251
|
|
247
|
-
add_index "groups_users", ["group_id", "user_id"], :
|
248
|
-
add_index "groups_users", ["group_id"], :
|
249
|
-
add_index "groups_users", ["user_id"], :
|
252
|
+
add_index "groups_users", ["group_id", "user_id"], name: "index_groups_users_on_group_id_and_user_id", using: :btree
|
253
|
+
add_index "groups_users", ["group_id"], name: "index_groups_users_on_group_id", using: :btree
|
254
|
+
add_index "groups_users", ["user_id"], name: "index_groups_users_on_user_id", using: :btree
|
250
255
|
|
251
|
-
create_table "leads", :
|
256
|
+
create_table "leads", force: :cascade do |t|
|
252
257
|
t.integer "user_id"
|
253
258
|
t.integer "campaign_id"
|
254
259
|
t.integer "assigned_to"
|
255
|
-
t.string "first_name", :
|
256
|
-
t.string "last_name", :
|
257
|
-
t.string "access", :
|
258
|
-
t.string "title", :
|
259
|
-
t.string "company", :
|
260
|
-
t.string "source", :
|
261
|
-
t.string "status", :
|
262
|
-
t.string "referred_by", :
|
263
|
-
t.string "email", :
|
264
|
-
t.string "alt_email", :
|
265
|
-
t.string "phone", :
|
266
|
-
t.string "mobile", :
|
267
|
-
t.string "blog", :
|
268
|
-
t.string "linkedin", :
|
269
|
-
t.string "facebook", :
|
270
|
-
t.string "twitter", :
|
271
|
-
t.integer "rating",
|
272
|
-
t.boolean "do_not_call",
|
260
|
+
t.string "first_name", limit: 64, default: "", null: false
|
261
|
+
t.string "last_name", limit: 64, default: "", null: false
|
262
|
+
t.string "access", limit: 8, default: "Public"
|
263
|
+
t.string "title", limit: 64
|
264
|
+
t.string "company", limit: 64
|
265
|
+
t.string "source", limit: 32
|
266
|
+
t.string "status", limit: 32
|
267
|
+
t.string "referred_by", limit: 64
|
268
|
+
t.string "email", limit: 254
|
269
|
+
t.string "alt_email", limit: 254
|
270
|
+
t.string "phone", limit: 32
|
271
|
+
t.string "mobile", limit: 32
|
272
|
+
t.string "blog", limit: 128
|
273
|
+
t.string "linkedin", limit: 128
|
274
|
+
t.string "facebook", limit: 128
|
275
|
+
t.string "twitter", limit: 128
|
276
|
+
t.integer "rating", default: 0, null: false
|
277
|
+
t.boolean "do_not_call", default: false, null: false
|
273
278
|
t.datetime "deleted_at"
|
274
|
-
t.datetime "created_at"
|
275
|
-
t.datetime "updated_at"
|
279
|
+
t.datetime "created_at"
|
280
|
+
t.datetime "updated_at"
|
276
281
|
t.string "background_info"
|
277
|
-
t.string "skype", :
|
282
|
+
t.string "skype", limit: 128
|
278
283
|
t.text "subscribed_users"
|
279
284
|
end
|
280
285
|
|
281
|
-
add_index "leads", ["assigned_to"], :
|
282
|
-
add_index "leads", ["user_id", "last_name", "deleted_at"], :
|
286
|
+
add_index "leads", ["assigned_to"], name: "index_leads_on_assigned_to", using: :btree
|
287
|
+
add_index "leads", ["user_id", "last_name", "deleted_at"], name: "index_leads_on_user_id_and_last_name_and_deleted_at", unique: true, using: :btree
|
283
288
|
|
284
|
-
create_table "lists", :
|
289
|
+
create_table "lists", force: :cascade do |t|
|
285
290
|
t.string "name"
|
286
291
|
t.text "url"
|
287
|
-
t.datetime "created_at"
|
288
|
-
t.datetime "updated_at"
|
292
|
+
t.datetime "created_at"
|
293
|
+
t.datetime "updated_at"
|
289
294
|
t.integer "user_id"
|
290
295
|
end
|
291
296
|
|
292
|
-
add_index "lists", ["user_id"], :
|
297
|
+
add_index "lists", ["user_id"], name: "index_lists_on_user_id", using: :btree
|
293
298
|
|
294
|
-
create_table "opportunities", :
|
299
|
+
create_table "opportunities", force: :cascade do |t|
|
295
300
|
t.integer "user_id"
|
296
301
|
t.integer "campaign_id"
|
297
302
|
t.integer "assigned_to"
|
298
|
-
t.string "name", :
|
299
|
-
t.string "access", :
|
300
|
-
t.string "source", :
|
301
|
-
t.string "stage", :
|
303
|
+
t.string "name", limit: 64, default: "", null: false
|
304
|
+
t.string "access", limit: 8, default: "Public"
|
305
|
+
t.string "source", limit: 32
|
306
|
+
t.string "stage", limit: 32
|
302
307
|
t.integer "probability"
|
303
|
-
t.decimal "amount",
|
304
|
-
t.decimal "discount",
|
308
|
+
t.decimal "amount", precision: 12, scale: 2
|
309
|
+
t.decimal "discount", precision: 12, scale: 2
|
305
310
|
t.date "closes_on"
|
306
311
|
t.datetime "deleted_at"
|
307
|
-
t.datetime "created_at"
|
308
|
-
t.datetime "updated_at"
|
312
|
+
t.datetime "created_at"
|
313
|
+
t.datetime "updated_at"
|
309
314
|
t.string "background_info"
|
310
315
|
t.text "subscribed_users"
|
311
316
|
end
|
312
317
|
|
313
|
-
add_index "opportunities", ["assigned_to"], :
|
314
|
-
add_index "opportunities", ["user_id", "name", "deleted_at"], :
|
318
|
+
add_index "opportunities", ["assigned_to"], name: "index_opportunities_on_assigned_to", using: :btree
|
319
|
+
add_index "opportunities", ["user_id", "name", "deleted_at"], name: "id_name_deleted", unique: true, using: :btree
|
315
320
|
|
316
|
-
create_table "permissions", :
|
321
|
+
create_table "permissions", force: :cascade do |t|
|
317
322
|
t.integer "user_id"
|
318
323
|
t.integer "asset_id"
|
319
324
|
t.string "asset_type"
|
320
|
-
t.datetime "created_at"
|
321
|
-
t.datetime "updated_at"
|
325
|
+
t.datetime "created_at"
|
326
|
+
t.datetime "updated_at"
|
322
327
|
t.integer "group_id"
|
323
328
|
end
|
324
329
|
|
325
|
-
add_index "permissions", ["asset_id", "asset_type"], :
|
326
|
-
add_index "permissions", ["group_id"], :
|
327
|
-
add_index "permissions", ["user_id"], :
|
330
|
+
add_index "permissions", ["asset_id", "asset_type"], name: "index_permissions_on_asset_id_and_asset_type", using: :btree
|
331
|
+
add_index "permissions", ["group_id"], name: "index_permissions_on_group_id", using: :btree
|
332
|
+
add_index "permissions", ["user_id"], name: "index_permissions_on_user_id", using: :btree
|
328
333
|
|
329
|
-
create_table "preferences", :
|
334
|
+
create_table "preferences", force: :cascade do |t|
|
330
335
|
t.integer "user_id"
|
331
|
-
t.string "name", :
|
336
|
+
t.string "name", limit: 32, default: "", null: false
|
332
337
|
t.text "value"
|
333
|
-
t.datetime "created_at"
|
334
|
-
t.datetime "updated_at"
|
338
|
+
t.datetime "created_at"
|
339
|
+
t.datetime "updated_at"
|
335
340
|
end
|
336
341
|
|
337
|
-
add_index "preferences", ["user_id", "name"], :
|
342
|
+
add_index "preferences", ["user_id", "name"], name: "index_preferences_on_user_id_and_name", using: :btree
|
338
343
|
|
339
|
-
create_table "sessions", :
|
340
|
-
t.string "session_id", :
|
344
|
+
create_table "sessions", force: :cascade do |t|
|
345
|
+
t.string "session_id", null: false
|
341
346
|
t.text "data"
|
342
|
-
t.datetime "created_at"
|
343
|
-
t.datetime "updated_at"
|
347
|
+
t.datetime "created_at"
|
348
|
+
t.datetime "updated_at"
|
344
349
|
end
|
345
350
|
|
346
|
-
add_index "sessions", ["session_id"], :
|
347
|
-
add_index "sessions", ["updated_at"], :
|
351
|
+
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
|
352
|
+
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
|
348
353
|
|
349
|
-
create_table "settings", :
|
350
|
-
t.string "name", :
|
354
|
+
create_table "settings", force: :cascade do |t|
|
355
|
+
t.string "name", limit: 32, default: "", null: false
|
351
356
|
t.text "value"
|
352
|
-
t.datetime "created_at"
|
353
|
-
t.datetime "updated_at"
|
357
|
+
t.datetime "created_at"
|
358
|
+
t.datetime "updated_at"
|
354
359
|
end
|
355
360
|
|
356
|
-
add_index "settings", ["name"], :
|
361
|
+
add_index "settings", ["name"], name: "index_settings_on_name", using: :btree
|
357
362
|
|
358
|
-
create_table "taggings", :
|
363
|
+
create_table "taggings", force: :cascade do |t|
|
359
364
|
t.integer "tag_id"
|
360
365
|
t.integer "taggable_id"
|
361
366
|
t.integer "tagger_id"
|
362
367
|
t.string "tagger_type"
|
363
|
-
t.string "taggable_type", :
|
364
|
-
t.string "context", :
|
368
|
+
t.string "taggable_type", limit: 50
|
369
|
+
t.string "context", limit: 50
|
365
370
|
t.datetime "created_at"
|
366
371
|
end
|
367
372
|
|
368
|
-
add_index "taggings", ["tag_id"], :
|
369
|
-
add_index "taggings", ["taggable_id", "taggable_type", "context"], :
|
373
|
+
add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context"], name: "taggings_idx", unique: true, using: :btree
|
374
|
+
add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
|
370
375
|
|
371
|
-
create_table "tags", :
|
372
|
-
t.string
|
376
|
+
create_table "tags", force: :cascade do |t|
|
377
|
+
t.string "name"
|
378
|
+
t.integer "taggings_count", default: 0
|
373
379
|
end
|
374
380
|
|
375
|
-
|
381
|
+
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
|
382
|
+
|
383
|
+
create_table "tasks", force: :cascade do |t|
|
376
384
|
t.integer "user_id"
|
377
385
|
t.integer "assigned_to"
|
378
386
|
t.integer "completed_by"
|
379
|
-
t.string "name",
|
387
|
+
t.string "name", default: "", null: false
|
380
388
|
t.integer "asset_id"
|
381
389
|
t.string "asset_type"
|
382
|
-
t.string "priority", :
|
383
|
-
t.string "category", :
|
384
|
-
t.string "bucket", :
|
390
|
+
t.string "priority", limit: 32
|
391
|
+
t.string "category", limit: 32
|
392
|
+
t.string "bucket", limit: 32
|
385
393
|
t.datetime "due_at"
|
386
394
|
t.datetime "completed_at"
|
387
395
|
t.datetime "deleted_at"
|
388
|
-
t.datetime "created_at"
|
389
|
-
t.datetime "updated_at"
|
396
|
+
t.datetime "created_at"
|
397
|
+
t.datetime "updated_at"
|
390
398
|
t.string "background_info"
|
391
399
|
t.text "subscribed_users"
|
392
400
|
end
|
393
401
|
|
394
|
-
add_index "tasks", ["assigned_to"], :
|
395
|
-
add_index "tasks", ["user_id", "name", "deleted_at"], :
|
396
|
-
|
397
|
-
create_table "users", :
|
398
|
-
t.string "username", :
|
399
|
-
t.string "email", :
|
400
|
-
t.string "first_name", :
|
401
|
-
t.string "last_name", :
|
402
|
-
t.string "title", :
|
403
|
-
t.string "company", :
|
404
|
-
t.string "alt_email", :
|
405
|
-
t.string "phone", :
|
406
|
-
t.string "mobile", :
|
407
|
-
t.string "aim", :
|
408
|
-
t.string "yahoo", :
|
409
|
-
t.string "google", :
|
410
|
-
t.string "skype", :
|
411
|
-
t.string "password_hash",
|
412
|
-
t.string "password_salt",
|
413
|
-
t.string "persistence_token",
|
414
|
-
t.string "perishable_token",
|
415
|
-
t.datetime "last_request_at"
|
402
|
+
add_index "tasks", ["assigned_to"], name: "index_tasks_on_assigned_to", using: :btree
|
403
|
+
add_index "tasks", ["user_id", "name", "deleted_at"], name: "index_tasks_on_user_id_and_name_and_deleted_at", unique: true, using: :btree
|
404
|
+
|
405
|
+
create_table "users", force: :cascade do |t|
|
406
|
+
t.string "username", limit: 32, default: "", null: false
|
407
|
+
t.string "email", limit: 254, default: "", null: false
|
408
|
+
t.string "first_name", limit: 32
|
409
|
+
t.string "last_name", limit: 32
|
410
|
+
t.string "title", limit: 64
|
411
|
+
t.string "company", limit: 64
|
412
|
+
t.string "alt_email", limit: 254
|
413
|
+
t.string "phone", limit: 32
|
414
|
+
t.string "mobile", limit: 32
|
415
|
+
t.string "aim", limit: 32
|
416
|
+
t.string "yahoo", limit: 32
|
417
|
+
t.string "google", limit: 32
|
418
|
+
t.string "skype", limit: 32
|
419
|
+
t.string "password_hash", default: "", null: false
|
420
|
+
t.string "password_salt", default: "", null: false
|
421
|
+
t.string "persistence_token", default: "", null: false
|
422
|
+
t.string "perishable_token", default: "", null: false
|
416
423
|
t.datetime "last_login_at"
|
417
424
|
t.datetime "current_login_at"
|
418
425
|
t.string "last_login_ip"
|
419
426
|
t.string "current_login_ip"
|
420
|
-
t.integer "login_count",
|
427
|
+
t.integer "login_count", default: 0, null: false
|
421
428
|
t.datetime "deleted_at"
|
422
|
-
t.datetime "created_at"
|
423
|
-
t.datetime "updated_at"
|
424
|
-
t.boolean "admin",
|
429
|
+
t.datetime "created_at"
|
430
|
+
t.datetime "updated_at"
|
431
|
+
t.boolean "admin", default: false, null: false
|
425
432
|
t.datetime "suspended_at"
|
426
433
|
t.string "single_access_token"
|
427
434
|
end
|
428
435
|
|
429
|
-
add_index "users", ["email"], :
|
430
|
-
add_index "users", ["
|
431
|
-
add_index "users", ["
|
432
|
-
add_index "users", ["
|
433
|
-
add_index "users", ["username", "deleted_at"], :name => "index_users_on_username_and_deleted_at", :unique => true
|
436
|
+
add_index "users", ["email"], name: "index_users_on_email", using: :btree
|
437
|
+
add_index "users", ["perishable_token"], name: "index_users_on_perishable_token", using: :btree
|
438
|
+
add_index "users", ["persistence_token"], name: "index_users_on_persistence_token", using: :btree
|
439
|
+
add_index "users", ["username", "deleted_at"], name: "index_users_on_username_and_deleted_at", unique: true, using: :btree
|
434
440
|
|
435
|
-
create_table "versions", :
|
436
|
-
t.string "item_type",
|
437
|
-
t.integer "item_id",
|
438
|
-
t.string "event", :
|
441
|
+
create_table "versions", force: :cascade do |t|
|
442
|
+
t.string "item_type", null: false
|
443
|
+
t.integer "item_id", null: false
|
444
|
+
t.string "event", limit: 512, null: false
|
439
445
|
t.string "whodunnit"
|
440
446
|
t.text "object"
|
441
447
|
t.datetime "created_at"
|
442
448
|
t.text "object_changes"
|
443
449
|
t.integer "related_id"
|
444
450
|
t.string "related_type"
|
451
|
+
t.integer "transaction_id"
|
445
452
|
end
|
446
453
|
|
447
|
-
add_index "versions", ["created_at"], :
|
448
|
-
add_index "versions", ["item_type", "item_id"], :
|
449
|
-
add_index "versions", ["
|
454
|
+
add_index "versions", ["created_at"], name: "index_versions_on_created_at", using: :btree
|
455
|
+
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id", using: :btree
|
456
|
+
add_index "versions", ["transaction_id"], name: "index_versions_on_transaction_id", using: :btree
|
457
|
+
add_index "versions", ["whodunnit"], name: "index_versions_on_whodunnit", using: :btree
|
450
458
|
|
451
459
|
end
|