spina 0.6.22 → 0.6.23

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spina might be problematic. Click here for more details.

Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/db/migrate/20150507135428_create_spina_tables.rb +160 -0
  3. data/lib/generators/spina/install_generator.rb +47 -0
  4. data/lib/generators/spina/templates/application.html.erb +16 -0
  5. data/lib/generators/spina/templates/homepage.html.erb +3 -0
  6. data/lib/generators/spina/templates/show.html.erb +3 -0
  7. data/lib/generators/spina/templates/spina.rb +3 -0
  8. data/lib/generators/spina/templates/theme.rb +42 -0
  9. data/lib/spina/version.rb +1 -1
  10. data/lib/tasks/spina_tasks.rake +5 -9
  11. data/test/dummy/config/initializers/spina.rb +1 -56
  12. data/test/dummy/config/initializers/themes/default.rb +38 -0
  13. data/test/dummy/config/routes.rb +1 -1
  14. data/test/dummy/db/migrate/20150507153614_create_spina_tables.spina.rb +161 -0
  15. data/test/dummy/db/schema.rb +1 -1
  16. data/test/dummy/log/development.log +2005 -0
  17. data/test/lib/generators/spina/install_generator_test.rb +16 -0
  18. metadata +12 -54
  19. data/app/views/spina/pages/_page.html.haml +0 -3
  20. data/app/views/spina/pages/homepage.html.haml +0 -3
  21. data/app/views/spina/pages/show.html.haml +0 -1
  22. data/db/migrate/20130412140449_create_spina_pages.rb +0 -15
  23. data/db/migrate/20130412140656_change_columns_pages.rb +0 -6
  24. data/db/migrate/20130412173041_create_spina_users.rb +0 -12
  25. data/db/migrate/20130412175403_create_spina_page_parts.rb +0 -12
  26. data/db/migrate/20130412175531_change_admin_of_users.rb +0 -5
  27. data/db/migrate/20130412180027_create_spina_page_includes.rb +0 -12
  28. data/db/migrate/20130412182257_create_spina_photos.rb +0 -9
  29. data/db/migrate/20130412191946_create_spina_accounts.rb +0 -16
  30. data/db/migrate/20130414145608_create_spina_inquiries.rb +0 -13
  31. data/db/migrate/20130422094248_add_theme_to_spina_accounts.rb +0 -5
  32. data/db/migrate/20130422161041_remove_theme_from_spina_accounts.rb +0 -5
  33. data/db/migrate/20130422194143_change_default_value_column_archived_inquiries.rb +0 -5
  34. data/db/migrate/20130425080630_change_page_includes.rb +0 -8
  35. data/db/migrate/20130426122705_add_parent_id_to_spina_pages.rb +0 -5
  36. data/db/migrate/20130426133425_change_colum_n_spina_pages_again.rb +0 -5
  37. data/db/migrate/20130426133606_bring_out_the_nukes.rb +0 -6
  38. data/db/migrate/20130429092708_add_name_to_spina_pages.rb +0 -5
  39. data/db/migrate/20130429124414_change_column_stomme_onzin.rb +0 -6
  40. data/db/migrate/20130503072744_add_last_logged_in_to_users.rb +0 -5
  41. data/db/migrate/20130503073613_change_column_spina_users.rb +0 -5
  42. data/db/migrate/20130503104857_create_spina_spina_files.rb +0 -9
  43. data/db/migrate/20130503105356_add_file_to_spina_page_parts.rb +0 -5
  44. data/db/migrate/20130503105943_change_columns_spina_files.rb +0 -6
  45. data/db/migrate/20130503110240_fix_namespaces.rb +0 -12
  46. data/db/migrate/20130503133649_create_spina_galleries.rb +0 -10
  47. data/db/migrate/20130504163456_add_seo_title_to_spina_pages.rb +0 -5
  48. data/db/migrate/20130516132913_add_spam_to_spina_inquiries.rb +0 -5
  49. data/db/migrate/20130523132347_add_page_partable_to_spina_page_parts.rb +0 -137
  50. data/db/migrate/20130527124130_remove_deprecated_columns_from_spina_page_parts.rb +0 -11
  51. data/db/migrate/20130715151201_switch_to_nested_sets_instead_of_position_pages.rb +0 -10
  52. data/db/migrate/20130719120007_add_skip_to_first_child_and_templates_to_spina_pages.rb +0 -7
  53. data/db/migrate/20130719121520_add_draft_to_spina_pages.rb +0 -5
  54. data/db/migrate/20130719122139_add_link_url_to_spina_pages.rb +0 -5
  55. data/db/migrate/20130719134545_rename_spina_file_to_attachments.rb +0 -9
  56. data/db/migrate/20130725111749_add_ancestry_to_spina_pages.rb +0 -10
  57. data/db/migrate/20130730185527_add_materialized_path_to_spina_pages.rb +0 -5
  58. data/db/migrate/20130918133920_change_column_page_parts.rb +0 -6
  59. data/db/migrate/20130919074011_create_spina_texts.rb +0 -9
  60. data/db/migrate/20130919074023_create_spina_lines.rb +0 -9
  61. data/db/migrate/20130919074838_remove_column_from_spina_page_parts.rb +0 -5
  62. data/db/migrate/20131210122702_change_column_spina_texts.rb +0 -5
  63. data/db/migrate/20131212080016_add_required_stuff_to_spina_accounts.rb +0 -6
  64. data/db/migrate/20140225141812_create_layout_parts.rb +0 -12
  65. data/db/migrate/20140225151146_add_account_id_to_spina_layout_parts.rb +0 -5
  66. data/db/migrate/20140407095608_add_active_to_spina_pages.rb +0 -5
  67. data/db/migrate/20140711154425_add_robots_allowed_to_spina_accounts.rb +0 -5
  68. data/db/migrate/20140718095419_add_position_to_spina_photo_collections_photos.rb +0 -5
  69. data/db/migrate/20150402144347_create_structures.rb +0 -27
  70. data/db/migrate/20150430085527_create_spina_colors.rb +0 -8
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/install/install_generator'
3
+
4
+ module Spina
5
+ class InstallGeneratorTest < Rails::Generators::TestCase
6
+ tests InstallGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.22
4
+ version: 0.6.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bram Jetten
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-07 00:00:00.000000000 Z
12
+ date: 2015-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -412,10 +412,7 @@ files:
412
412
  - app/views/spina/inquiries/create.html.haml
413
413
  - app/views/spina/inquiries/index.html.haml
414
414
  - app/views/spina/inquiry_mailer/inquiry.html.haml
415
- - app/views/spina/pages/_page.html.haml
416
- - app/views/spina/pages/homepage.html.haml
417
415
  - app/views/spina/pages/robots.text.erb
418
- - app/views/spina/pages/show.html.haml
419
416
  - app/views/spina/shared/_admin_bar.html.haml
420
417
  - app/views/spina/shared/_analytics.html.erb
421
418
  - app/views/spina/shared/_navigation.html.haml
@@ -425,56 +422,14 @@ files:
425
422
  - config/locales/en.yml
426
423
  - config/locales/nl.yml
427
424
  - config/routes.rb
428
- - db/migrate/20130412140449_create_spina_pages.rb
429
- - db/migrate/20130412140656_change_columns_pages.rb
430
- - db/migrate/20130412173041_create_spina_users.rb
431
- - db/migrate/20130412175403_create_spina_page_parts.rb
432
- - db/migrate/20130412175531_change_admin_of_users.rb
433
- - db/migrate/20130412180027_create_spina_page_includes.rb
434
- - db/migrate/20130412182257_create_spina_photos.rb
435
- - db/migrate/20130412191946_create_spina_accounts.rb
436
- - db/migrate/20130414145608_create_spina_inquiries.rb
437
- - db/migrate/20130422094248_add_theme_to_spina_accounts.rb
438
- - db/migrate/20130422161041_remove_theme_from_spina_accounts.rb
439
- - db/migrate/20130422194143_change_default_value_column_archived_inquiries.rb
440
- - db/migrate/20130425080630_change_page_includes.rb
441
- - db/migrate/20130426122705_add_parent_id_to_spina_pages.rb
442
- - db/migrate/20130426133425_change_colum_n_spina_pages_again.rb
443
- - db/migrate/20130426133606_bring_out_the_nukes.rb
444
- - db/migrate/20130429092708_add_name_to_spina_pages.rb
445
- - db/migrate/20130429124414_change_column_stomme_onzin.rb
446
- - db/migrate/20130503072744_add_last_logged_in_to_users.rb
447
- - db/migrate/20130503073613_change_column_spina_users.rb
448
- - db/migrate/20130503104857_create_spina_spina_files.rb
449
- - db/migrate/20130503105356_add_file_to_spina_page_parts.rb
450
- - db/migrate/20130503105943_change_columns_spina_files.rb
451
- - db/migrate/20130503110240_fix_namespaces.rb
452
- - db/migrate/20130503133649_create_spina_galleries.rb
453
- - db/migrate/20130504163456_add_seo_title_to_spina_pages.rb
454
- - db/migrate/20130516132913_add_spam_to_spina_inquiries.rb
455
- - db/migrate/20130523132347_add_page_partable_to_spina_page_parts.rb
456
- - db/migrate/20130527124130_remove_deprecated_columns_from_spina_page_parts.rb
457
- - db/migrate/20130715151201_switch_to_nested_sets_instead_of_position_pages.rb
458
- - db/migrate/20130719120007_add_skip_to_first_child_and_templates_to_spina_pages.rb
459
- - db/migrate/20130719121520_add_draft_to_spina_pages.rb
460
- - db/migrate/20130719122139_add_link_url_to_spina_pages.rb
461
- - db/migrate/20130719134545_rename_spina_file_to_attachments.rb
462
- - db/migrate/20130725111749_add_ancestry_to_spina_pages.rb
463
- - db/migrate/20130730185527_add_materialized_path_to_spina_pages.rb
464
- - db/migrate/20130918133920_change_column_page_parts.rb
465
- - db/migrate/20130919074011_create_spina_texts.rb
466
- - db/migrate/20130919074023_create_spina_lines.rb
467
- - db/migrate/20130919074838_remove_column_from_spina_page_parts.rb
468
- - db/migrate/20131210122702_change_column_spina_texts.rb
469
- - db/migrate/20131212080016_add_required_stuff_to_spina_accounts.rb
470
- - db/migrate/20140225141812_create_layout_parts.rb
471
- - db/migrate/20140225151146_add_account_id_to_spina_layout_parts.rb
472
- - db/migrate/20140407095608_add_active_to_spina_pages.rb
473
- - db/migrate/20140711154425_add_robots_allowed_to_spina_accounts.rb
474
- - db/migrate/20140718095419_add_position_to_spina_photo_collections_photos.rb
475
- - db/migrate/20150402144347_create_structures.rb
476
- - db/migrate/20150430085527_create_spina_colors.rb
425
+ - db/migrate/20150507135428_create_spina_tables.rb
477
426
  - db/seeds.rb
427
+ - lib/generators/spina/install_generator.rb
428
+ - lib/generators/spina/templates/application.html.erb
429
+ - lib/generators/spina/templates/homepage.html.erb
430
+ - lib/generators/spina/templates/show.html.erb
431
+ - lib/generators/spina/templates/spina.rb
432
+ - lib/generators/spina/templates/theme.rb
478
433
  - lib/spina.rb
479
434
  - lib/spina/engine.rb
480
435
  - lib/spina/plugin.rb
@@ -503,6 +458,7 @@ files:
503
458
  - test/dummy/config/initializers/secret_token.rb
504
459
  - test/dummy/config/initializers/session_store.rb
505
460
  - test/dummy/config/initializers/spina.rb
461
+ - test/dummy/config/initializers/themes/default.rb
506
462
  - test/dummy/config/initializers/wrap_parameters.rb
507
463
  - test/dummy/config/locales/en.yml
508
464
  - test/dummy/config/locales/nl.yml
@@ -557,6 +513,7 @@ files:
557
513
  - test/dummy/db/migrate/20150430085614_add_robots_allowed_to_spina_accounts.spina.rb
558
514
  - test/dummy/db/migrate/20150430085615_add_position_to_spina_photo_collections_photos.spina.rb
559
515
  - test/dummy/db/migrate/20150430085616_create_spina_colors.spina.rb
516
+ - test/dummy/db/migrate/20150507153614_create_spina_tables.spina.rb
560
517
  - test/dummy/db/schema.rb
561
518
  - test/dummy/db/seeds.rb
562
519
  - test/dummy/log/development.log
@@ -940,6 +897,7 @@ files:
940
897
  - test/functional/spina/spina/inquiry_mailer_test.rb
941
898
  - test/functional/spina/users_controller_test.rb
942
899
  - test/integration/navigation_test.rb
900
+ - test/lib/generators/spina/install_generator_test.rb
943
901
  - test/models/spina/line_test.rb
944
902
  - test/models/spina/text_test.rb
945
903
  - test/spina_test.rb
@@ -1,3 +0,0 @@
1
- %h1= @page.title
2
-
3
- = raw @page.content(:content)
@@ -1,3 +0,0 @@
1
- %h1= @page.title
2
-
3
- = raw @page.content(:left_column)
@@ -1 +0,0 @@
1
- = render 'page'
@@ -1,15 +0,0 @@
1
- class CreateSpinaPages < ActiveRecord::Migration
2
- def change
3
- create_table :spina_pages do |t|
4
- t.string :title
5
- t.string :menu_title
6
- t.string :description
7
- t.boolean :show_in_menu
8
- t.string :position
9
- t.string :slug
10
- t.integer :deletable
11
-
12
- t.timestamps
13
- end
14
- end
15
- end
@@ -1,6 +0,0 @@
1
- class ChangeColumnsPages < ActiveRecord::Migration
2
- def change
3
- change_column :spina_pages, :show_in_menu, :boolean, default: true
4
- change_column :spina_pages, :deletable, :boolean, default: true
5
- end
6
- end
@@ -1,12 +0,0 @@
1
- class CreateSpinaUsers < ActiveRecord::Migration
2
- def change
3
- create_table :spina_users do |t|
4
- t.string :name
5
- t.string :email
6
- t.string :password_digest
7
- t.boolean :admin
8
-
9
- t.timestamps
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- class CreateSpinaPageParts < ActiveRecord::Migration
2
- def change
3
- create_table :spina_page_parts do |t|
4
- t.string :name
5
- t.integer :position, default: 0
6
- t.string :content_type
7
- t.string :tag
8
-
9
- t.timestamps
10
- end
11
- end
12
- end
@@ -1,5 +0,0 @@
1
- class ChangeAdminOfUsers < ActiveRecord::Migration
2
- def change
3
- change_column :spina_users, :admin, :boolean, default: false
4
- end
5
- end
@@ -1,12 +0,0 @@
1
- class CreateSpinaPageIncludes < ActiveRecord::Migration
2
- def change
3
- create_table :spina_page_includes do |t|
4
- t.text :content
5
- t.integer :page_id
6
- t.integer :page_part_id
7
- t.integer :photo_id
8
-
9
- t.timestamps
10
- end
11
- end
12
- end
@@ -1,9 +0,0 @@
1
- class CreateSpinaPhotos < ActiveRecord::Migration
2
- def change
3
- create_table :spina_photos do |t|
4
- t.string :file
5
-
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,16 +0,0 @@
1
- class CreateSpinaAccounts < ActiveRecord::Migration
2
- def change
3
- create_table :spina_accounts do |t|
4
- t.string :name
5
- t.string :address
6
- t.string :postal_code
7
- t.string :city
8
- t.string :phone
9
- t.string :email
10
- t.text :preferences
11
- t.string :logo
12
-
13
- t.timestamps
14
- end
15
- end
16
- end
@@ -1,13 +0,0 @@
1
- class CreateSpinaInquiries < ActiveRecord::Migration
2
- def change
3
- create_table :spina_inquiries do |t|
4
- t.string :name
5
- t.string :email
6
- t.string :phone
7
- t.text :message
8
- t.boolean :archived
9
-
10
- t.timestamps
11
- end
12
- end
13
- end
@@ -1,5 +0,0 @@
1
- class AddThemeToSpinaAccounts < ActiveRecord::Migration
2
- def change
3
- add_column :spina_accounts, :theme, :string
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class RemoveThemeFromSpinaAccounts < ActiveRecord::Migration
2
- def change
3
- remove_column :spina_accounts, :theme
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class ChangeDefaultValueColumnArchivedInquiries < ActiveRecord::Migration
2
- def change
3
- change_column :spina_inquiries, :archived, :boolean, default: false
4
- end
5
- end
@@ -1,8 +0,0 @@
1
- class ChangePageIncludes < ActiveRecord::Migration
2
- def change
3
- drop_table :spina_page_includes
4
- add_column :spina_page_parts, :page_id, :integer
5
- add_column :spina_page_parts, :photo_id, :integer
6
- add_column :spina_page_parts, :content, :text
7
- end
8
- end
@@ -1,5 +0,0 @@
1
- class AddParentIdToSpinaPages < ActiveRecord::Migration
2
- def change
3
- add_column :spina_pages, :parent_id, :integer
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class ChangeColumNSpinaPagesAgain < ActiveRecord::Migration
2
- def change
3
- change_column :spina_pages, :parent_id, :integer
4
- end
5
- end
@@ -1,6 +0,0 @@
1
- class BringOutTheNukes < ActiveRecord::Migration
2
- def change
3
- remove_column :spina_pages, :parent_id
4
- add_column :spina_pages, :parent_id, :integer
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- class AddNameToSpinaPages < ActiveRecord::Migration
2
- def change
3
- add_column :spina_pages, :name, :string
4
- end
5
- end
@@ -1,6 +0,0 @@
1
- class ChangeColumnStommeOnzin < ActiveRecord::Migration
2
- def change
3
- remove_column :spina_pages, :position
4
- add_column :spina_pages, :position, :integer
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- class AddLastLoggedInToUsers < ActiveRecord::Migration
2
- def change
3
- add_column :spina_users, :last_logged_in, :date
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class ChangeColumnSpinaUsers < ActiveRecord::Migration
2
- def change
3
- change_column :spina_users, :last_logged_in, :datetime
4
- end
5
- end
@@ -1,9 +0,0 @@
1
- class CreateSpinaSpinaFiles < ActiveRecord::Migration
2
- def change
3
- create_table :spina_spina_files do |t|
4
- t.string :file
5
-
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,5 +0,0 @@
1
- class AddFileToSpinaPageParts < ActiveRecord::Migration
2
- def change
3
- add_column :spina_page_parts, :file_id, :integer
4
- end
5
- end
@@ -1,6 +0,0 @@
1
- class ChangeColumnsSpinaFiles < ActiveRecord::Migration
2
- def change
3
- remove_column :spina_page_parts, :file_id
4
- add_column :spina_page_parts, :file, :string
5
- end
6
- end
@@ -1,12 +0,0 @@
1
- class FixNamespaces < ActiveRecord::Migration
2
- def change
3
- drop_table :spina_spina_files
4
-
5
- create_table :spina_files do |t|
6
- t.string :file
7
- t.integer :page_part_id
8
-
9
- t.timestamps
10
- end
11
- end
12
- end
@@ -1,10 +0,0 @@
1
- class CreateSpinaGalleries < ActiveRecord::Migration
2
- def change
3
- create_table :spina_galleries do |t|
4
- t.integer :photo_id
5
- t.integer :page_part_id
6
-
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,5 +0,0 @@
1
- class AddSeoTitleToSpinaPages < ActiveRecord::Migration
2
- def change
3
- add_column :spina_pages, :seo_title, :string
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class AddSpamToSpinaInquiries < ActiveRecord::Migration
2
- def change
3
- add_column :spina_inquiries, :spam, :boolean
4
- end
5
- end
@@ -1,137 +0,0 @@
1
- # This migration comes from spina (originally 20130523132347)
2
- class AddPagePartableToSpinaPageParts < ActiveRecord::Migration
3
-
4
- module Spina
5
- def self.table_name_prefix
6
- 'spina_'
7
- end
8
-
9
- class PagePart < ActiveRecord::Base
10
- belongs_to :page
11
- belongs_to :page_partable, polymorphic: true
12
-
13
- belongs_to :photo
14
- belongs_to :file
15
- has_many :files
16
- has_many :galleries
17
- has_many :photos, through: :galleries
18
- end
19
-
20
- class Gallery < ActiveRecord::Base
21
- belongs_to :photo
22
- belongs_to :page_part
23
- end
24
-
25
- class Photo < ActiveRecord::Base
26
- has_many :page_parts, through: :galleries
27
-
28
- has_many :page_parts, as: :page_partable
29
- has_and_belongs_to_many :photo_collections, join_table: 'spina_photo_collections_photos'
30
- end
31
-
32
- class PhotoCollection < ActiveRecord::Base
33
- has_one :page_part, as: :page_partable
34
- has_and_belongs_to_many :photos, join_table: 'spina_photo_collections_photos'
35
- end
36
-
37
- class File < ActiveRecord::Base
38
- belongs_to :page_part
39
-
40
- has_many :page_parts, as: :page_partable
41
- has_and_belongs_to_many :file_collections, join_table: 'spina_file_collections_files'
42
- end
43
-
44
- class FileCollection < ActiveRecord::Base
45
- has_one :page_part, as: :page_partable
46
- has_and_belongs_to_many :files, join_table: 'spina_file_collections_files'
47
- end
48
-
49
- end
50
-
51
-
52
- def up
53
- change_table :spina_page_parts do |t|
54
- t.references :page_partable, polymorphic: true
55
- end
56
-
57
- create_table :spina_photo_collections do |t|
58
- t.timestamps
59
- end
60
-
61
- create_table :spina_photo_collections_photos do |t|
62
- t.integer :photo_collection_id
63
- t.integer :photo_id
64
- end
65
-
66
- create_table :spina_file_collections do |t|
67
- t.timestamps
68
- end
69
-
70
- create_table :spina_file_collections_files do |t|
71
- t.integer :file_collection_id
72
- t.integer :file_id
73
- end
74
-
75
- Spina::PagePart.reset_column_information
76
- Spina::PagePart.all.each do |part|
77
- case part.content_type
78
- when "photo"
79
- puts part.inspect
80
- if part.photo_id
81
- part.update_attributes!({ page_partable_type: "Spina::Photo", page_partable_id: part.photo.id }, without_protection: true)
82
- else
83
- part.destroy
84
- end
85
- when "photos"
86
- photo_collection = Spina::PhotoCollection.create
87
- part.update_attributes!({ page_partable_type: "Spina::PhotoCollection", page_partable_id: photo_collection.id }, without_protection: true)
88
- part.photos.each do |photo|
89
- photo_collection.photos << photo
90
- end
91
- when "file"
92
- # puts part.file.inspect
93
- part.update_attributes!({ page_partable_type: "Spina::File", page_partable_id: nil }, without_protection: true)
94
- when "files"
95
- file_collection = Spina::FileCollection.create
96
- part.update_attributes!({ page_partable_type: "Spina::FileCollection", page_partable_id: file_collection.id }, without_protection: true)
97
- part.files.each do |file|
98
- file_collection.files << file
99
- end
100
- when "text"
101
- part.update_attributes!({ page_partable_type: "Text" }, without_protection: true)
102
- when "line"
103
- part.update_attributes!({ page_partable_type: "Line" }, without_protection: true)
104
- end
105
- end
106
-
107
- drop_table :spina_galleries
108
- remove_column :spina_page_parts, :content_type
109
- remove_column :spina_page_parts, :photo_id
110
- remove_column :spina_files, :page_part_id
111
-
112
- end
113
-
114
- def down
115
-
116
- change_table :spina_page_parts do |t|
117
- t.remove_references :page_partable, polymorphic: true
118
- end
119
-
120
- drop_table :spina_photo_collections
121
- drop_table :spina_photo_collections_photos
122
- drop_table :spina_file_collections
123
- drop_table :spina_file_collections_files
124
-
125
- create_table :spina_galleries do |t|
126
- t.integer :photo_id
127
- t.integer :page_part_id
128
-
129
- t.timestamps
130
- end
131
-
132
- add_column :spina_page_parts, :content_type
133
- add_column :spina_page_parts, :photo_id
134
- add_column :spina_files, :page_part_id
135
- end
136
-
137
- end