dm_event 4.2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +23 -0
- data/README.md +33 -0
- data/Rakefile +36 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-64x44.png +0 -0
- data/app/assets/javascripts/dm_event/admin.js +94 -0
- data/app/assets/stylesheets/dm_event/admin.css +152 -0
- data/app/assets/stylesheets/dm_event/application.css +65 -0
- data/app/controllers/dm_event/admin/admin_controller.rb +13 -0
- data/app/controllers/dm_event/admin/registrations_controller.rb +411 -0
- data/app/controllers/dm_event/admin/workshop_prices_controller.rb +73 -0
- data/app/controllers/dm_event/admin/workshops_controller.rb +147 -0
- data/app/controllers/dm_event/application_controller.rb +23 -0
- data/app/controllers/dm_event/payments_controller.rb +83 -0
- data/app/controllers/dm_event/registrations_controller.rb +368 -0
- data/app/datatables/registration_datatable.rb +117 -0
- data/app/helpers/dm_event/application_helper.rb +4 -0
- data/app/helpers/dm_event/registrations_helper.rb +14 -0
- data/app/helpers/dm_event/workshops_helper.rb +41 -0
- data/app/mailers/payment_reminder_mailer.rb +25 -0
- data/app/mailers/registration_notify_mailer.rb +31 -0
- data/app/models/dm_event/concerns/ability.rb +38 -0
- data/app/models/dm_event/concerns/registration_state_email.rb +80 -0
- data/app/models/dm_event/concerns/registration_state_machine.rb +218 -0
- data/app/models/dm_event/concerns/user_profile.rb +20 -0
- data/app/models/dm_event/model_decorators.rb +6 -0
- data/app/models/dm_event/permitted_params.rb +35 -0
- data/app/models/payment.rb +48 -0
- data/app/models/registration.rb +297 -0
- data/app/models/workshop.rb +247 -0
- data/app/models/workshop_price.rb +118 -0
- data/app/presenters/event_common_presenter.rb +31 -0
- data/app/presenters/registration_presenter.rb +34 -0
- data/app/presenters/workshop_presenter.rb +22 -0
- data/app/views/dm_event/admin/registrations/_form.html.erb +297 -0
- data/app/views/dm_event/admin/registrations/action_state.js.erb +1 -0
- data/app/views/dm_event/admin/registrations/edit.html.erb +1 -0
- data/app/views/dm_event/admin/registrations/index.html.erb +0 -0
- data/app/views/dm_event/admin/workshop_prices/_form.html.erb +62 -0
- data/app/views/dm_event/admin/workshop_prices/edit.html.erb +2 -0
- data/app/views/dm_event/admin/workshop_prices/index.html.erb +31 -0
- data/app/views/dm_event/admin/workshop_prices/new.html.erb +2 -0
- data/app/views/dm_event/admin/workshops/_form.html.erb +61 -0
- data/app/views/dm_event/admin/workshops/_header_menu.html.erb +21 -0
- data/app/views/dm_event/admin/workshops/_registration_stats.html.erb +58 -0
- data/app/views/dm_event/admin/workshops/additional_configuration.html.erb +47 -0
- data/app/views/dm_event/admin/workshops/edit.html.erb +2 -0
- data/app/views/dm_event/admin/workshops/edit_system_email.html.erb +75 -0
- data/app/views/dm_event/admin/workshops/financials.html.erb +179 -0
- data/app/views/dm_event/admin/workshops/index.html.erb +100 -0
- data/app/views/dm_event/admin/workshops/lost_users.html.erb +44 -0
- data/app/views/dm_event/admin/workshops/new.html.erb +2 -0
- data/app/views/dm_event/admin/workshops/show.html.erb +47 -0
- data/app/views/dm_event/admin/workshops/user_outstanding_balances.html.erb +29 -0
- data/app/views/dm_event/liquid_tags/_funding_project_status.html.erb +27 -0
- data/app/views/dm_event/payments/_registrations_paypal_standard.html.erb +23 -0
- data/app/views/dm_event/payments/_registrations_sofort.html.erb +18 -0
- data/app/views/dm_event/registrations/_section_address.html.erb +30 -0
- data/app/views/dm_event/registrations/_section_custom_fields.html.erb +7 -0
- data/app/views/dm_event/registrations/_section_prices.html.erb +33 -0
- data/app/views/dm_event/registrations/_workshop_price.html.erb +18 -0
- data/app/views/dm_event/registrations/choose_payment.html.erb +5 -0
- data/app/views/dm_event/registrations/closed.html.erb +14 -0
- data/app/views/dm_event/registrations/new.html.erb +30 -0
- data/app/views/dm_event/registrations/success.html.erb +15 -0
- data/app/views/layouts/email_templates/dm_event_email_layout.html.erb +318 -0
- data/app/views/layouts/email_templates/dm_event_email_layout.text.erb +1 -0
- data/app/views/layouts/email_templates/dm_event_payment_reminder.html.erb +22 -0
- data/app/views/layouts/email_templates/dm_event_payment_reminder.text.erb +19 -0
- data/app/views/layouts/email_templates/dm_event_registration_notify.html.erb +21 -0
- data/app/views/layouts/email_templates/dm_event_registration_notify.text.erb +13 -0
- data/config/initializers/dm_event.rb +1 -0
- data/config/initializers/liquid_init.rb +2 -0
- data/config/locales/ems.cs.yml +51 -0
- data/config/locales/ems.de.yml +51 -0
- data/config/locales/ems.en.yml +51 -0
- data/config/locales/ems.fi.yml +51 -0
- data/config/locales/ems.ja.yml +51 -0
- data/config/routes.rb +40 -0
- data/db/migrate/20130510155617_create_events.rb +98 -0
- data/db/migrate/20130516124327_add_locale_to_registration.rb +5 -0
- data/db/migrate/20130516204454_add_user_profile_to_registration.rb +11 -0
- data/db/migrate/20130518092324_add_require_address.rb +7 -0
- data/db/migrate/20130609145812_add_workshop_published.rb +5 -0
- data/db/migrate/20130624134506_add_amount_currency.rb +16 -0
- data/db/migrate/20130703131515_add_workshop_currency.rb +5 -0
- data/db/migrate/20130913083529_add_event_funding_type.rb +6 -0
- data/db/migrate/20130914105736_add_enable_payments.rb +5 -0
- data/db/migrate/20130916160033_add_sidebar_to_workshop.rb +5 -0
- data/db/migrate/20130917161700_add_show_address.rb +5 -0
- data/db/migrate/20131116180719_add_default_funding_goal.rb +8 -0
- data/db/migrate/20131127165445_add_payment_reminder.rb +5 -0
- data/db/migrate/20140122204702_add_event_image.rb +5 -0
- data/db/migrate/20140523165342_add_workshop_summary.rb +5 -0
- data/db/migrate/20140605052208_add_uuid_to_registration.rb +10 -0
- data/db/migrate/20140707152124_add_registration_comment_count.rb +5 -0
- data/db/migrate/20140708142312_add_payment_comment.rb +20 -0
- data/db/migrate/20150709125105_add_payment_reminder_history.rb +16 -0
- data/db/migrate/20160810081542_add_bcc_contact_email.rb +5 -0
- data/db/migrate/20160821150120_index_foreign_keys_in_ems_registrations.rb +9 -0
- data/db/migrate/20160821150121_index_foreign_keys_in_ems_workshop_price_translations.rb +5 -0
- data/db/migrate/20160821150122_index_foreign_keys_in_ems_workshop_prices.rb +6 -0
- data/db/migrate/20160821150123_index_foreign_keys_in_ems_workshop_translations.rb +5 -0
- data/db/migrate/20160821150124_index_foreign_keys_in_ems_workshops.rb +6 -0
- data/lib/dm_event/engine.rb +20 -0
- data/lib/dm_event/liquid/tags/funding_project_status.rb +55 -0
- data/lib/dm_event.rb +4 -0
- data/lib/tasks/dm_event_tasks.rake +4 -0
- data/spec/controllers/registrations_controller_spec.rb +152 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ability.rb +10 -0
- data/spec/dummy/app/models/user.rb +6 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +11 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20141114170927_add_globalize_countries.dm_core.rb +50 -0
- data/spec/dummy/db/migrate/20141114170928_devise_create_users.dm_core.rb +46 -0
- data/spec/dummy/db/migrate/20141114170929_add_user_fields.dm_core.rb +14 -0
- data/spec/dummy/db/migrate/20141114170930_rolify_create_roles.dm_core.rb +20 -0
- data/spec/dummy/db/migrate/20141114170931_add_last_access.dm_core.rb +10 -0
- data/spec/dummy/db/migrate/20141114170932_create_versions.dm_core.rb +19 -0
- data/spec/dummy/db/migrate/20141114170933_add_object_changes_column_to_versions.dm_core.rb +12 -0
- data/spec/dummy/db/migrate/20141114170934_create_dm_core_accounts.dm_core.rb +13 -0
- data/spec/dummy/db/migrate/20141114170935_add_account_to_users.dm_core.rb +9 -0
- data/spec/dummy/db/migrate/20141114170936_create_preferences.dm_core.rb +13 -0
- data/spec/dummy/db/migrate/20141114170937_create_comments.dm_core.rb +22 -0
- data/spec/dummy/db/migrate/20141114170938_add_activity.dm_core.rb +21 -0
- data/spec/dummy/db/migrate/20141114170939_add_type_to_comments.dm_core.rb +9 -0
- data/spec/dummy/db/migrate/20141114170940_add_category.dm_core.rb +28 -0
- data/spec/dummy/db/migrate/20141114170941_create_email_table.dm_core.rb +26 -0
- data/spec/dummy/db/migrate/20141114170942_add_user_profile.dm_core.rb +46 -0
- data/spec/dummy/db/migrate/20141114170943_add_profile_email.dm_core.rb +14 -0
- data/spec/dummy/db/migrate/20141114170944_create_payment_history.dm_core.rb +37 -0
- data/spec/dummy/db/migrate/20141114170945_change_anchor_field.dm_core.rb +10 -0
- data/spec/dummy/db/migrate/20141114170946_create_user_site_profile.dm_core.rb +27 -0
- data/spec/dummy/db/migrate/20141114170947_add_avatar.dm_core.rb +12 -0
- data/spec/dummy/db/migrate/20141114170948_add_notify_to_payment_history.dm_core.rb +8 -0
- data/spec/dummy/db/migrate/20141114170949_acts_as_votable_migration.dm_core.rb +28 -0
- data/spec/dummy/db/migrate/20141114170950_add_user_site_profile_uuid.dm_core.rb +19 -0
- data/spec/dummy/db/migrate/20141114170951_add_invoice_id.dm_core.rb +7 -0
- data/spec/dummy/db/migrate/20141114170952_acts_as_follower_migration.dm_core.rb +18 -0
- data/spec/dummy/db/migrate/20141114170953_rename_invoice_id.dm_core.rb +12 -0
- data/spec/dummy/db/migrate/20141114170954_add_core_addresses.dm_core.rb +18 -0
- data/spec/dummy/db/migrate/20141114170955_papertrail_increase_column.dm_core.rb +9 -0
- data/spec/dummy/db/migrate/20141114170956_acts_as_taggable_on_migration.dm_core.rb +32 -0
- data/spec/dummy/db/migrate/20141114170957_add_missing_unique_indices.dm_core.rb +23 -0
- data/spec/dummy/db/migrate/20141114170958_add_taggings_counter_cache_to_tags.dm_core.rb +16 -0
- data/spec/dummy/db/migrate/20141114170959_create_custom_fields.dm_core.rb +40 -0
- data/spec/dummy/db/migrate/20141114170960_add_missing_taggable_index.dm_core.rb +11 -0
- data/spec/dummy/db/migrate/20141119103740_create_cms.dm_cms.rb +92 -0
- data/spec/dummy/db/migrate/20141119103741_add_account_to_cms.dm_cms.rb +11 -0
- data/spec/dummy/db/migrate/20141119103742_create_blog.dm_cms.rb +62 -0
- data/spec/dummy/db/migrate/20141119103743_add_notification_sent.dm_cms.rb +6 -0
- data/spec/dummy/db/migrate/20141119103744_add_blog_comment.dm_cms.rb +8 -0
- data/spec/dummy/db/migrate/20141119103745_add_blog_image.dm_cms.rb +6 -0
- data/spec/dummy/db/migrate/20141119103746_rename_snippet_slug.dm_cms.rb +14 -0
- data/spec/dummy/db/migrate/20141119103747_add_requires_subscription_blog.dm_cms.rb +8 -0
- data/spec/dummy/db/migrate/20141119103748_add_pages_ranked_model.dm_cms.rb +23 -0
- data/spec/dummy/db/migrate/20141119103749_add_blog_owner.dm_cms.rb +7 -0
- data/spec/dummy/db/migrate/20141119103750_create_media_files.dm_cms.rb +30 -0
- data/spec/dummy/db/migrate/20141119103751_add_cmspage_summary.dm_cms.rb +7 -0
- data/spec/dummy/db/migrate/20141119103752_add_blog_image_email_header.dm_cms.rb +6 -0
- data/spec/dummy/db/migrate/20141119103753_add_header_image.dm_cms.rb +10 -0
- data/spec/dummy/db/migrate/20160128154135_add_favored_locale.dm_core.rb +17 -0
- data/spec/dummy/db/migrate/20160128154136_update_papertrail_v4.dm_core.rb +41 -0
- data/spec/dummy/db/schema.rb +677 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/account_factory.rb +7 -0
- data/spec/factories/registration_factory.rb +13 -0
- data/spec/factories/workshop_factory.rb +25 -0
- data/spec/factories/workshop_price_factory.rb +19 -0
- data/spec/models/registration_spec.rb +83 -0
- data/spec/models/workshop_spec.rb +26 -0
- data/spec/rails_helper.rb +70 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/accounts.rb +17 -0
- data/spec/support/devise.rb +44 -0
- data/spec/support/fix_locale.rb +57 -0
- metadata +520 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: 3e8fdc05d6cae67029b3df06fd3b9038e07fb17203a03023e294b47b574fa691f8fac2c1e8c52bf8325b9405f66eb163f020131be5585547f220325c23aadb7c
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 58b6eb8bf1c6cd06cdd764335937a48adc702897462d2077ef19d0f7d2e19e246962a248220c920c7b8370faf060879422436fe441c89b16f58162288f03caf4
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
Binary file
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This migration comes from dm_core (originally 20121023202117)
|
3
|
+
#------------------------------------------------------------------------------
|
4
|
+
class AddGlobalizeCountries < ActiveRecord::Migration
|
5
|
+
def up
|
6
|
+
create_table "globalize_countries", :force => true do |t|
|
7
|
+
t.string "code", :limit => 2
|
8
|
+
t.string "english_name"
|
9
|
+
t.string "date_format"
|
10
|
+
t.string "currency_format"
|
11
|
+
t.string "currency_code", :limit => 3
|
12
|
+
t.string "thousands_sep", :limit => 2
|
13
|
+
t.string "decimal_sep", :limit => 2
|
14
|
+
t.string "currency_decimal_sep", :limit => 2
|
15
|
+
t.string "number_grouping_scheme"
|
16
|
+
t.string "continent"
|
17
|
+
t.string "locale"
|
18
|
+
end
|
19
|
+
|
20
|
+
add_index "globalize_countries", ["code"], :name => "index_globalize_countries_on_code"
|
21
|
+
add_index "globalize_countries", ["locale"], :name => "index_globalize_countries_on_locale"
|
22
|
+
|
23
|
+
create_table "globalize_languages", :force => true do |t|
|
24
|
+
t.string "iso_639_1", :limit => 2
|
25
|
+
t.string "iso_639_2", :limit => 3
|
26
|
+
t.string "iso_639_3", :limit => 3
|
27
|
+
t.string "rfc_3066"
|
28
|
+
t.string "english_name"
|
29
|
+
t.string "english_name_locale"
|
30
|
+
t.string "english_name_modifier"
|
31
|
+
t.string "native_name"
|
32
|
+
t.string "native_name_locale"
|
33
|
+
t.string "native_name_modifier"
|
34
|
+
t.boolean "macro_language"
|
35
|
+
t.string "direction"
|
36
|
+
t.string "pluralization"
|
37
|
+
t.string "scope", :limit => 1
|
38
|
+
end
|
39
|
+
|
40
|
+
add_index "globalize_languages", ["iso_639_1"], :name => "index_globalize_languages_on_iso_639_1"
|
41
|
+
add_index "globalize_languages", ["iso_639_2"], :name => "index_globalize_languages_on_iso_639_2"
|
42
|
+
add_index "globalize_languages", ["iso_639_3"], :name => "index_globalize_languages_on_iso_639_3"
|
43
|
+
add_index "globalize_languages", ["rfc_3066"], :name => "index_globalize_languages_on_rfc_3066"
|
44
|
+
end
|
45
|
+
|
46
|
+
def down
|
47
|
+
drop_table :globalize_countries
|
48
|
+
drop_table :globalize_languages
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20121028125329)
|
2
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table(:users) do |t|
|
5
|
+
## Database authenticatable
|
6
|
+
t.string :email, :null => false, :default => ""
|
7
|
+
t.string :encrypted_password, :null => false, :default => ""
|
8
|
+
|
9
|
+
## Recoverable
|
10
|
+
t.string :reset_password_token
|
11
|
+
t.datetime :reset_password_sent_at
|
12
|
+
|
13
|
+
## Rememberable
|
14
|
+
t.datetime :remember_created_at
|
15
|
+
|
16
|
+
## Trackable
|
17
|
+
t.integer :sign_in_count, :default => 0
|
18
|
+
t.datetime :current_sign_in_at
|
19
|
+
t.datetime :last_sign_in_at
|
20
|
+
t.string :current_sign_in_ip
|
21
|
+
t.string :last_sign_in_ip
|
22
|
+
|
23
|
+
## Confirmable
|
24
|
+
t.string :confirmation_token
|
25
|
+
t.datetime :confirmed_at
|
26
|
+
t.datetime :confirmation_sent_at
|
27
|
+
t.string :unconfirmed_email # Only if using reconfirmable
|
28
|
+
|
29
|
+
## Lockable
|
30
|
+
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
31
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
32
|
+
# t.datetime :locked_at
|
33
|
+
|
34
|
+
## Token authenticatable
|
35
|
+
# t.string :authentication_token
|
36
|
+
|
37
|
+
t.timestamps null: true
|
38
|
+
end
|
39
|
+
|
40
|
+
add_index :users, :email, :unique => true
|
41
|
+
add_index :users, :reset_password_token, :unique => true
|
42
|
+
add_index :users, :confirmation_token, :unique => true
|
43
|
+
# add_index :users, :unlock_token, :unique => true
|
44
|
+
# add_index :users, :authentication_token, :unique => true
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20121028125831)
|
2
|
+
class AddUserFields < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
add_column :users, :first_name, :string
|
5
|
+
add_column :users, :last_name, :string
|
6
|
+
add_column :users, :country_id, :integer
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_column :users, :first_name
|
11
|
+
remove_column :users, :last_name
|
12
|
+
remove_column :users, :country_id
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20121028153317)
|
2
|
+
class RolifyCreateRoles < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table(:roles) do |t|
|
5
|
+
t.string :name
|
6
|
+
t.references :resource, :polymorphic => true
|
7
|
+
|
8
|
+
t.timestamps null: true
|
9
|
+
end
|
10
|
+
|
11
|
+
create_table(:users_roles, :id => false) do |t|
|
12
|
+
t.references :user
|
13
|
+
t.references :role
|
14
|
+
end
|
15
|
+
|
16
|
+
add_index(:roles, :name)
|
17
|
+
add_index(:roles, [ :name, :resource_type, :resource_id ])
|
18
|
+
add_index(:users_roles, [ :user_id, :role_id ])
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20121110213512)
|
2
|
+
class CreateVersions < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
create_table :versions do |t|
|
5
|
+
t.string :item_type, :null => false
|
6
|
+
t.integer :item_id, :null => false
|
7
|
+
t.string :event, :null => false
|
8
|
+
t.string :whodunnit
|
9
|
+
t.text :object
|
10
|
+
t.datetime :created_at
|
11
|
+
end
|
12
|
+
add_index :versions, [:item_type, :item_id]
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
remove_index :versions, [:item_type, :item_id]
|
17
|
+
drop_table :versions
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20121110213513)
|
2
|
+
class AddObjectChangesColumnToVersions < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
add_column :versions, :object_changes, :text
|
5
|
+
add_column :versions, :locale, :string
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.down
|
9
|
+
remove_column :versions, :object_changes
|
10
|
+
remove_column :versions, :locale
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130206121535)
|
2
|
+
class CreateDmCoreAccounts < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :core_accounts do |t|
|
5
|
+
t.string :company_name
|
6
|
+
t.string :contact_email
|
7
|
+
t.string :domain
|
8
|
+
t.string :account_prefix
|
9
|
+
t.integer :default_site_id
|
10
|
+
t.timestamps null: true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130206223323)
|
2
|
+
class AddAccountToUsers < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :users, :account_id, :integer
|
5
|
+
add_index :users, :account_id
|
6
|
+
add_column :roles, :account_id, :integer
|
7
|
+
add_index :roles, :account_id
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130207170247)
|
2
|
+
class CreatePreferences < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :preferences do |t|
|
5
|
+
t.string :name, :null => false
|
6
|
+
t.references :owner, :polymorphic => true, :null => false
|
7
|
+
t.references :group, :polymorphic => true
|
8
|
+
t.string :value
|
9
|
+
t.timestamps null: true
|
10
|
+
end
|
11
|
+
add_index :preferences, [:owner_id, :owner_type, :name, :group_id, :group_type], :unique => true, :name => 'index_preferences_on_owner_and_name_and_preference'
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130321144726)
|
2
|
+
class CreateComments < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
create_table :core_comments do |t|
|
5
|
+
t.string :title, :limit => 50, :default => ""
|
6
|
+
t.text :comment
|
7
|
+
t.references :commentable, :polymorphic => true
|
8
|
+
t.references :user
|
9
|
+
t.string :role, :default => "comments"
|
10
|
+
t.integer :account_id
|
11
|
+
t.timestamps null: true
|
12
|
+
end
|
13
|
+
|
14
|
+
add_index :core_comments, :commentable_type
|
15
|
+
add_index :core_comments, :commentable_id
|
16
|
+
add_index :core_comments, :user_id
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.down
|
20
|
+
drop_table :core_comments
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130402203739)
|
2
|
+
class AddActivity < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :core_activities do |t|
|
5
|
+
t.integer :account_id
|
6
|
+
t.references :user
|
7
|
+
t.string :browser
|
8
|
+
t.string :session_id
|
9
|
+
t.string :ip_address
|
10
|
+
t.string :controller
|
11
|
+
t.string :action
|
12
|
+
t.string :params
|
13
|
+
t.string :slug
|
14
|
+
t.string :lesson
|
15
|
+
t.datetime :created_at
|
16
|
+
end
|
17
|
+
|
18
|
+
add_index :core_activities, :account_id
|
19
|
+
add_index :core_activities, :user_id
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130415095617)
|
2
|
+
class AddTypeToComments < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :core_comments, :type, :string
|
5
|
+
add_column :core_comments, :ancestry, :string
|
6
|
+
add_column :core_comments, :ancestry_depth, :integer, :default => 0
|
7
|
+
rename_column :core_comments, :comment, :body
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130429191051)
|
2
|
+
class AddCategory < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
create_table "core_category_translations", :force => true do |t|
|
5
|
+
t.integer :core_category_id
|
6
|
+
t.string :locale
|
7
|
+
t.string :name
|
8
|
+
t.string :description
|
9
|
+
t.datetime :created_at
|
10
|
+
t.datetime :updated_at
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index "core_category_translations", ["core_category_id"], :name => "index_category_translation"
|
14
|
+
|
15
|
+
create_table "core_categories", :force => true do |t|
|
16
|
+
t.string :type
|
17
|
+
t.integer :row_order
|
18
|
+
t.integer :account_id
|
19
|
+
t.datetime :created_on
|
20
|
+
t.datetime :updated_on
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def down
|
25
|
+
drop_table :core_categories
|
26
|
+
drop_table :core_category_translations
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130513112751)
|
2
|
+
class CreateEmailTable < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
create_table :core_system_email_translations, :force => true do |t|
|
5
|
+
t.integer :core_system_email_id
|
6
|
+
t.string :locale
|
7
|
+
t.string :subject
|
8
|
+
t.text :body
|
9
|
+
t.datetime :created_at
|
10
|
+
t.datetime :updated_at
|
11
|
+
end
|
12
|
+
|
13
|
+
create_table :core_system_emails, :force => true do |t|
|
14
|
+
t.string :email_type
|
15
|
+
t.references :emailable, :polymorphic => true
|
16
|
+
t.datetime :created_at
|
17
|
+
t.datetime :updated_at
|
18
|
+
t.integer :account_id
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def down
|
23
|
+
drop_table :core_system_emails
|
24
|
+
drop_table :core_system_email_translations
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130516143539)
|
2
|
+
class AddUserProfile < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
create_table :user_profiles, :force => true do |t|
|
5
|
+
t.integer :user_id
|
6
|
+
t.string :public_name, :limit => 50, :default => ""
|
7
|
+
t.string :first_name, :limit => 50, :default => ""
|
8
|
+
t.string :last_name, :limit => 50, :default => ""
|
9
|
+
t.string :address, :limit => 70, :default => ""
|
10
|
+
t.string :address2, :limit => 70, :default => ""
|
11
|
+
t.string :city, :limit => 30, :default => ""
|
12
|
+
t.string :state, :limit => 30, :default => ""
|
13
|
+
t.string :zipcode, :limit => 10, :default => ""
|
14
|
+
t.integer :country_id, :default => 0
|
15
|
+
t.string :phone, :limit => 20, :default => ""
|
16
|
+
t.string :cell, :limit => 20, :default => ""
|
17
|
+
t.string :fax, :limit => 20, :default => ""
|
18
|
+
t.string :workphone, :limit => 20, :default => ""
|
19
|
+
t.string :website, :limit => 50, :default => ""
|
20
|
+
t.string :gender, :limit => 1, :default => ""
|
21
|
+
t.integer :status, :default => 0
|
22
|
+
t.integer :lock_version, :default => 0
|
23
|
+
t.datetime :last_access_at
|
24
|
+
t.datetime :created_at
|
25
|
+
t.datetime :updated_at
|
26
|
+
t.integer :account_id
|
27
|
+
end
|
28
|
+
|
29
|
+
User.all.find_each do |user|
|
30
|
+
Account.current = Account.find(user.account_id)
|
31
|
+
p = user.create_user_profile
|
32
|
+
p.update_attributes(first_name: user.attributes['first_name'], last_name: user.attributes['last_name'],
|
33
|
+
country_id: user.attributes['country_id'],
|
34
|
+
public_name: "#{user.attributes['first_name']}")
|
35
|
+
p.update_attribute(:last_access_at, user.attributes['last_access_at'])
|
36
|
+
end
|
37
|
+
remove_column :users, :first_name
|
38
|
+
remove_column :users, :last_name
|
39
|
+
remove_column :users, :country_id
|
40
|
+
remove_column :users, :last_access_at
|
41
|
+
end
|
42
|
+
|
43
|
+
def down
|
44
|
+
drop_table :user_profiles
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130518155712)
|
2
|
+
class AddProfileEmail < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
add_column :user_profiles, :email, :string
|
5
|
+
User.all.find_each do |user|
|
6
|
+
Account.current = Account.find(user.account_id)
|
7
|
+
user.user_profile.update_attribute(:email, user.attributes['email'])
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def down
|
12
|
+
remove_column :user_profiles, :email
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130620145610)
|
2
|
+
class CreatePaymentHistory < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
create_table :core_payment_histories, :force => true do |t|
|
5
|
+
t.integer :owner_id
|
6
|
+
t.string :owner_type, :limit => 30
|
7
|
+
t.integer :anchor_id # unique number tying paid item to our item
|
8
|
+
t.string :order_ref # order number
|
9
|
+
t.string :item_ref # specfic item number
|
10
|
+
t.string :item_name # item's name
|
11
|
+
t.integer :quantity # number of items
|
12
|
+
t.string :cost # cost of item, as a string
|
13
|
+
t.string :discount # any coupon/dicsount
|
14
|
+
t.integer :total_cents # total amount in cents
|
15
|
+
t.string :total_currency, :limit => 3 # currency 3 char code
|
16
|
+
t.string :payment_method # how payment was made: cash, credit card, etc
|
17
|
+
t.datetime :payment_date # date of payment
|
18
|
+
t.string :bill_to_name # who actually paid / was billed to
|
19
|
+
t.text :item_details # any specific item details sent by payment processor
|
20
|
+
t.text :order_details # any specific order details sent by payment processor
|
21
|
+
t.string :current_stage # current stage of payment
|
22
|
+
t.integer :user_profile_id # user_profile if payment was enetered manually
|
23
|
+
t.datetime :created_on
|
24
|
+
t.integer :account_id
|
25
|
+
end
|
26
|
+
|
27
|
+
add_index "core_payment_histories", ["anchor_id"], :name => "index_payment_histories_on_anchor_id"
|
28
|
+
add_index "core_payment_histories", ["item_ref"], :name => "index_payment_histories_on_item_ref"
|
29
|
+
add_index "core_payment_histories", ["order_ref"], :name => "index_payment_histories_on_order_ref"
|
30
|
+
add_index "core_payment_histories", ["owner_id"], :name => "index_payment_histories_on_owner_id"
|
31
|
+
add_index "core_payment_histories", ["owner_type"], :name => "index_payment_histories_on_owner_type"
|
32
|
+
end
|
33
|
+
|
34
|
+
def down
|
35
|
+
drop_table :core_payment_histories
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130625091108)
|
2
|
+
class ChangeAnchorField < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
change_column :core_payment_histories, :anchor_id, :string, :limit => 20
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
change_column :core_payment_histories, :anchor_id, :integer
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130628112848)
|
2
|
+
class CreateUserSiteProfile < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
create_table :user_site_profiles, :force => true do |t|
|
5
|
+
t.integer :user_id
|
6
|
+
t.datetime :last_access_at
|
7
|
+
t.datetime :created_at
|
8
|
+
t.datetime :updated_at
|
9
|
+
t.integer :account_id
|
10
|
+
end
|
11
|
+
|
12
|
+
User.all.find_each do |user|
|
13
|
+
Account.current = Account.find(user.account_id)
|
14
|
+
p = user.user_site_profiles.create
|
15
|
+
p.update_attribute(:account_id, user.attributes['account_id'])
|
16
|
+
p.update_attribute(:last_access_at, user.user_profile.attributes['last_access_at'])
|
17
|
+
p.update_attribute(:created_at, user.attributes['created_at'])
|
18
|
+
p.update_attribute(:updated_at, user.attributes['updated_at'])
|
19
|
+
end
|
20
|
+
remove_column :user_profiles, :last_access_at
|
21
|
+
end
|
22
|
+
|
23
|
+
def down
|
24
|
+
drop_table :user_site_profiles
|
25
|
+
add_column :user_profiles, :last_access_at, :datetime
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130708150236)
|
2
|
+
class AddAvatar < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :user_profiles, :public_avatar, :string
|
5
|
+
add_column :user_profiles, :public_avatar_file_size, :integer
|
6
|
+
add_column :user_profiles, :public_avatar_content_type, :string
|
7
|
+
add_column :user_profiles, :private_avatar, :string
|
8
|
+
add_column :user_profiles, :private_avatar_file_size, :integer
|
9
|
+
add_column :user_profiles, :private_avatar_content_type, :string
|
10
|
+
add_column :user_profiles, :use_private_avatar_for_public, :boolean, :default => false
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20130914132041)
|
2
|
+
class AddNotifyToPaymentHistory < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :core_payment_histories, :notify_data, :text
|
5
|
+
add_column :core_payment_histories, :transaction_id, :string
|
6
|
+
rename_column :core_payment_histories, :current_stage, :status
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20140105133446)
|
2
|
+
class ActsAsVotableMigration < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
create_table :votes do |t|
|
5
|
+
|
6
|
+
t.references :votable, :polymorphic => true
|
7
|
+
t.references :voter, :polymorphic => true
|
8
|
+
|
9
|
+
t.boolean :vote_flag
|
10
|
+
t.string :vote_scope
|
11
|
+
t.integer :vote_weight
|
12
|
+
|
13
|
+
t.timestamps null: true
|
14
|
+
end
|
15
|
+
|
16
|
+
if ActiveRecord::VERSION::MAJOR < 4
|
17
|
+
add_index :votes, [:votable_id, :votable_type]
|
18
|
+
add_index :votes, [:voter_id, :voter_type]
|
19
|
+
end
|
20
|
+
|
21
|
+
add_index :votes, [:voter_id, :voter_type, :vote_scope]
|
22
|
+
add_index :votes, [:votable_id, :votable_type, :vote_scope]
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.down
|
26
|
+
drop_table :votes
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20140107112418)
|
2
|
+
class UserSiteProfile < ActiveRecord::Base
|
3
|
+
end
|
4
|
+
|
5
|
+
class AddUserSiteProfileUuid < ActiveRecord::Migration
|
6
|
+
def up
|
7
|
+
add_column :user_site_profiles, :uuid, :string, :limit => 40
|
8
|
+
add_index :user_site_profiles, :uuid
|
9
|
+
|
10
|
+
#--- Create uuid for existing records
|
11
|
+
UserSiteProfile.all.each do |profile|
|
12
|
+
profile.update_attribute(:uuid, SecureRandom.uuid)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def down
|
17
|
+
remove_column :user_site_profiles, :uuid
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20140129110547)
|
2
|
+
class AddInvoiceId < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
# used to track an atomically increasing invoice id for an account (used in payments)
|
5
|
+
add_column :core_accounts, :invoice_id_counter, :integer
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20140201092656)
|
2
|
+
class ActsAsFollowerMigration < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
create_table :follows, :force => true do |t|
|
5
|
+
t.references :followable, :polymorphic => true, :null => false
|
6
|
+
t.references :follower, :polymorphic => true, :null => false
|
7
|
+
t.boolean :blocked, :default => false, :null => false
|
8
|
+
t.timestamps null: true
|
9
|
+
end
|
10
|
+
|
11
|
+
add_index :follows, ["follower_id", "follower_type"], :name => "fk_follows"
|
12
|
+
add_index :follows, ["followable_id", "followable_type"], :name => "fk_followables"
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
drop_table :follows
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from dm_core (originally 20140203131320)
|
2
|
+
class RenameInvoiceId < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
remove_column :core_accounts, :invoice_id_counter
|
5
|
+
add_column :core_accounts, :next_invoice_num, :integer, :default => 1000
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
remove_column :core_accounts, :next_invoice_num
|
10
|
+
add_column :core_accounts, :invoice_id_counter, :integer
|
11
|
+
end
|
12
|
+
end
|