dm_newsletter 4.2.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +33 -0
  4. data/Rakefile +30 -0
  5. data/app/assets/stylesheets/dm_newsletter/application.css +13 -0
  6. data/app/controllers/dm_newsletter/admin/admin_controller.rb +16 -0
  7. data/app/controllers/dm_newsletter/admin/newsletters_controller.rb +81 -0
  8. data/app/controllers/dm_newsletter/application_controller.rb +3 -0
  9. data/app/controllers/dm_newsletter/newsletters_controller.rb +50 -0
  10. data/app/helpers/dm_newsletter/newsletters_helper.rb +8 -0
  11. data/app/models/dm_newsletter/concerns/ability.rb +37 -0
  12. data/app/models/dm_newsletter/permitted_params.rb +20 -0
  13. data/app/models/mailchimp_newsletter.rb +217 -0
  14. data/app/models/mailchimp_newsletter_subscriber.rb +43 -0
  15. data/app/models/newsletter.rb +46 -0
  16. data/app/models/newsletter_subscriber.rb +257 -0
  17. data/app/models/standard_newsletter.rb +19 -0
  18. data/app/views/dm_newsletter/admin/newsletters/_form.html.erb +17 -0
  19. data/app/views/dm_newsletter/admin/newsletters/edit.html.erb +2 -0
  20. data/app/views/dm_newsletter/admin/newsletters/index.html.erb +32 -0
  21. data/app/views/dm_newsletter/admin/newsletters/new.html.erb +2 -0
  22. data/app/views/dm_newsletter/admin/newsletters/show.html.erb +46 -0
  23. data/config/locales/nms.cs.yml +15 -0
  24. data/config/locales/nms.de.yml +15 -0
  25. data/config/locales/nms.en.yml +15 -0
  26. data/config/locales/nms.fi.yml +15 -0
  27. data/config/locales/nms.ja.yml +15 -0
  28. data/config/routes.rb +15 -0
  29. data/db/20130730120724_create_subscribers.rb +32 -0
  30. data/db/migrate/20130729075442_create_newsletter.rb +24 -0
  31. data/lib/dm_newsletter.rb +4 -0
  32. data/lib/dm_newsletter/engine.rb +8 -0
  33. data/lib/tasks/dm_newsletter_tasks.rake +4 -0
  34. data/spec/dummy/README.rdoc +28 -0
  35. data/spec/dummy/Rakefile +6 -0
  36. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  37. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  38. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  39. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  40. data/spec/dummy/app/models/ability.rb +12 -0
  41. data/spec/dummy/app/models/user.rb +6 -0
  42. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  43. data/spec/dummy/bin/bundle +3 -0
  44. data/spec/dummy/bin/rails +4 -0
  45. data/spec/dummy/bin/rake +4 -0
  46. data/spec/dummy/config.ru +4 -0
  47. data/spec/dummy/config/application.rb +26 -0
  48. data/spec/dummy/config/boot.rb +5 -0
  49. data/spec/dummy/config/database.yml +25 -0
  50. data/spec/dummy/config/environment.rb +5 -0
  51. data/spec/dummy/config/environments/development.rb +37 -0
  52. data/spec/dummy/config/environments/production.rb +82 -0
  53. data/spec/dummy/config/environments/test.rb +39 -0
  54. data/spec/dummy/config/initializers/assets.rb +8 -0
  55. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  56. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  57. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  58. data/spec/dummy/config/initializers/inflections.rb +16 -0
  59. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  60. data/spec/dummy/config/initializers/session_store.rb +3 -0
  61. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  62. data/spec/dummy/config/locales/en.yml +23 -0
  63. data/spec/dummy/config/routes.rb +12 -0
  64. data/spec/dummy/config/secrets.yml +22 -0
  65. data/spec/dummy/db/development.sqlite3 +0 -0
  66. data/spec/dummy/db/migrate/20141114170927_add_globalize_countries.dm_core.rb +50 -0
  67. data/spec/dummy/db/migrate/20141114170928_devise_create_users.dm_core.rb +46 -0
  68. data/spec/dummy/db/migrate/20141114170929_add_user_fields.dm_core.rb +14 -0
  69. data/spec/dummy/db/migrate/20141114170930_rolify_create_roles.dm_core.rb +20 -0
  70. data/spec/dummy/db/migrate/20141114170931_add_last_access.dm_core.rb +10 -0
  71. data/spec/dummy/db/migrate/20141114170932_create_versions.dm_core.rb +19 -0
  72. data/spec/dummy/db/migrate/20141114170933_add_object_changes_column_to_versions.dm_core.rb +12 -0
  73. data/spec/dummy/db/migrate/20141114170934_create_dm_core_accounts.dm_core.rb +13 -0
  74. data/spec/dummy/db/migrate/20141114170935_add_account_to_users.dm_core.rb +9 -0
  75. data/spec/dummy/db/migrate/20141114170936_create_preferences.dm_core.rb +13 -0
  76. data/spec/dummy/db/migrate/20141114170937_create_comments.dm_core.rb +22 -0
  77. data/spec/dummy/db/migrate/20141114170938_add_activity.dm_core.rb +21 -0
  78. data/spec/dummy/db/migrate/20141114170939_add_type_to_comments.dm_core.rb +9 -0
  79. data/spec/dummy/db/migrate/20141114170940_add_category.dm_core.rb +28 -0
  80. data/spec/dummy/db/migrate/20141114170941_create_email_table.dm_core.rb +26 -0
  81. data/spec/dummy/db/migrate/20141114170942_add_user_profile.dm_core.rb +46 -0
  82. data/spec/dummy/db/migrate/20141114170943_add_profile_email.dm_core.rb +14 -0
  83. data/spec/dummy/db/migrate/20141114170944_create_payment_history.dm_core.rb +37 -0
  84. data/spec/dummy/db/migrate/20141114170945_change_anchor_field.dm_core.rb +10 -0
  85. data/spec/dummy/db/migrate/20141114170946_create_user_site_profile.dm_core.rb +27 -0
  86. data/spec/dummy/db/migrate/20141114170947_add_avatar.dm_core.rb +12 -0
  87. data/spec/dummy/db/migrate/20141114170948_add_notify_to_payment_history.dm_core.rb +8 -0
  88. data/spec/dummy/db/migrate/20141114170949_acts_as_votable_migration.dm_core.rb +28 -0
  89. data/spec/dummy/db/migrate/20141114170950_add_user_site_profile_uuid.dm_core.rb +19 -0
  90. data/spec/dummy/db/migrate/20141114170951_add_invoice_id.dm_core.rb +7 -0
  91. data/spec/dummy/db/migrate/20141114170952_acts_as_follower_migration.dm_core.rb +18 -0
  92. data/spec/dummy/db/migrate/20141114170953_rename_invoice_id.dm_core.rb +12 -0
  93. data/spec/dummy/db/migrate/20141114170954_add_core_addresses.dm_core.rb +18 -0
  94. data/spec/dummy/db/migrate/20141114170955_papertrail_increase_column.dm_core.rb +9 -0
  95. data/spec/dummy/db/migrate/20141114170956_acts_as_taggable_on_migration.dm_core.rb +32 -0
  96. data/spec/dummy/db/migrate/20141114170957_add_missing_unique_indices.dm_core.rb +23 -0
  97. data/spec/dummy/db/migrate/20141114170958_add_taggings_counter_cache_to_tags.dm_core.rb +16 -0
  98. data/spec/dummy/db/migrate/20141114170959_create_custom_fields.dm_core.rb +40 -0
  99. data/spec/dummy/db/migrate/20141114170960_add_missing_taggable_index.dm_core.rb +11 -0
  100. data/spec/dummy/db/migrate/20141119112030_create_cms.dm_cms.rb +92 -0
  101. data/spec/dummy/db/migrate/20141119112031_add_account_to_cms.dm_cms.rb +11 -0
  102. data/spec/dummy/db/migrate/20141119112032_create_blog.dm_cms.rb +62 -0
  103. data/spec/dummy/db/migrate/20141119112033_add_notification_sent.dm_cms.rb +6 -0
  104. data/spec/dummy/db/migrate/20141119112034_add_blog_comment.dm_cms.rb +8 -0
  105. data/spec/dummy/db/migrate/20141119112035_add_blog_image.dm_cms.rb +6 -0
  106. data/spec/dummy/db/migrate/20141119112036_rename_snippet_slug.dm_cms.rb +14 -0
  107. data/spec/dummy/db/migrate/20141119112037_add_requires_subscription_blog.dm_cms.rb +8 -0
  108. data/spec/dummy/db/migrate/20141119112038_add_pages_ranked_model.dm_cms.rb +23 -0
  109. data/spec/dummy/db/migrate/20141119112039_add_blog_owner.dm_cms.rb +7 -0
  110. data/spec/dummy/db/migrate/20141119112040_create_media_files.dm_cms.rb +30 -0
  111. data/spec/dummy/db/migrate/20141119112041_add_cmspage_summary.dm_cms.rb +7 -0
  112. data/spec/dummy/db/migrate/20141119112042_add_blog_image_email_header.dm_cms.rb +6 -0
  113. data/spec/dummy/db/migrate/20141119112043_add_header_image.dm_cms.rb +10 -0
  114. data/spec/dummy/db/migrate/20160128145239_add_favored_locale.dm_core.rb +17 -0
  115. data/spec/dummy/db/migrate/20160128145240_update_papertrail_v4.dm_core.rb +41 -0
  116. data/spec/dummy/db/schema.rb +593 -0
  117. data/spec/dummy/public/404.html +67 -0
  118. data/spec/dummy/public/422.html +67 -0
  119. data/spec/dummy/public/500.html +66 -0
  120. data/spec/dummy/public/favicon.ico +0 -0
  121. data/spec/factories/accounts.rb +9 -0
  122. data/spec/factories/user_profiles.rb +10 -0
  123. data/spec/factories/users.rb +19 -0
  124. data/spec/models/newsletter_spec.rb +9 -0
  125. data/spec/rails_helper.rb +70 -0
  126. data/spec/spec_helper.rb +85 -0
  127. data/spec/support/accounts.rb +17 -0
  128. data/spec/support/devise.rb +44 -0
  129. data/spec/support/fix_locale.rb +57 -0
  130. metadata +296 -0
@@ -0,0 +1,39 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+
37
+ # Raises error for missing translations
38
+ # config.action_view.raise_on_missing_translations = true
39
+ end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Precompile additional assets.
7
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -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,12 @@
1
+ Rails.application.routes.draw do
2
+
3
+ scope ":locale" do
4
+ devise_for :users, controllers: { registrations: "registrations", confirmations: 'confirmations' }
5
+ end
6
+
7
+ themes_for_rails
8
+
9
+ mount DmCore::Engine, at: '/'
10
+ mount DmNewsletter::Engine, at: '/'
11
+
12
+ end
@@ -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,10 @@
1
+ # This migration comes from dm_core (originally 20121105205634)
2
+ class AddLastAccess < ActiveRecord::Migration
3
+ def up
4
+ add_column :users, :last_access_at, :datetime
5
+ end
6
+
7
+ def down
8
+ remove_column :users, :last_access_at
9
+ end
10
+ 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