alchemy_cms 2.4.1 → 2.5.0.b2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. data/.travis.yml +1 -1
  2. data/README.md +18 -17
  3. data/alchemy_cms.gemspec +5 -10
  4. data/app/assets/images/alchemy/icons.png +0 -0
  5. data/app/assets/stylesheets/alchemy/archive.scss +27 -0
  6. data/app/assets/stylesheets/alchemy/base.scss +0 -51
  7. data/app/assets/stylesheets/alchemy/elements.scss +37 -2
  8. data/app/assets/stylesheets/alchemy/icons.scss +4 -0
  9. data/app/assets/stylesheets/alchemy/modules.scss +4 -0
  10. data/app/assets/stylesheets/alchemy/sitemap.scss +1 -1
  11. data/app/assets/stylesheets/alchemy/tables.scss +1 -1
  12. data/app/assets/stylesheets/alchemy/variables.scss +1 -0
  13. data/app/controllers/alchemy/admin/pages_controller.rb +1 -0
  14. data/app/controllers/alchemy/admin/pictures_controller.rb +22 -8
  15. data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
  16. data/app/controllers/alchemy/admin/sites_controller.rb +6 -0
  17. data/app/controllers/alchemy/base_controller.rb +8 -0
  18. data/app/controllers/alchemy/elements_controller.rb +33 -3
  19. data/app/controllers/alchemy/messages_controller.rb +47 -40
  20. data/app/controllers/alchemy/pages_controller.rb +8 -31
  21. data/app/controllers/alchemy/pictures_controller.rb +64 -30
  22. data/app/helpers/alchemy/admin/base_helper.rb +7 -0
  23. data/app/helpers/alchemy/admin/pages_helper.rb +12 -0
  24. data/app/helpers/alchemy/elements_helper.rb +2 -0
  25. data/app/helpers/alchemy/pages_helper.rb +30 -10
  26. data/app/helpers/alchemy/url_helper.rb +1 -0
  27. data/app/models/alchemy/content.rb +1 -2
  28. data/app/models/alchemy/element.rb +47 -2
  29. data/app/models/alchemy/language.rb +27 -14
  30. data/app/models/alchemy/page.rb +1 -1
  31. data/app/models/alchemy/picture.rb +46 -41
  32. data/app/models/alchemy/site.rb +44 -0
  33. data/app/views/alchemy/admin/elements/_element_head.html.erb +1 -0
  34. data/app/views/alchemy/admin/languages/index.html.erb +23 -0
  35. data/app/views/alchemy/admin/pages/edit.html.erb +27 -1
  36. data/app/views/alchemy/admin/pages/fold.js.erb +1 -0
  37. data/app/views/alchemy/admin/partials/_upload_form.html.erb +2 -0
  38. data/app/views/alchemy/admin/pictures/_picture.html.erb +24 -2
  39. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +5 -4
  40. data/app/views/alchemy/admin/pictures/create.js.erb +1 -9
  41. data/app/views/alchemy/admin/pictures/info.html.erb +42 -0
  42. data/app/views/alchemy/admin/resources/_form.html.erb +0 -2
  43. data/app/views/alchemy/admin/resources/_resource.html.erb +2 -1
  44. data/app/views/alchemy/admin/resources/index.html.erb +2 -1
  45. data/app/views/alchemy/elements/show.html.erb +1 -6
  46. data/app/views/alchemy/elements/show.js.erb +4 -10
  47. data/app/views/alchemy/essences/_essence_link_view.html.erb +1 -0
  48. data/app/views/alchemy/search/_form.html.erb +9 -6
  49. data/app/views/alchemy/search/_result.html.erb +1 -1
  50. data/bin/alchemy +13 -120
  51. data/config/alchemy/config.yml +7 -11
  52. data/config/alchemy/modules.yml +24 -12
  53. data/config/authorization_rules.rb +6 -2
  54. data/config/initializers/dragonfly.rb +20 -0
  55. data/config/locales/alchemy.de.yml +57 -28
  56. data/config/locales/alchemy.en.yml +18 -4
  57. data/config/routes.rb +4 -2
  58. data/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +21 -0
  59. data/db/migrate/20121205155004_create_alchemy_sites.rb +14 -0
  60. data/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +6 -0
  61. data/lib/alchemy/capistrano.rb +7 -2
  62. data/lib/alchemy/ferret_search.rb +84 -0
  63. data/lib/alchemy/picture_attributes.rb +29 -0
  64. data/lib/alchemy/seeder.rb +10 -16
  65. data/lib/alchemy/upgrader.rb +59 -8
  66. data/lib/alchemy/version.rb +1 -1
  67. data/lib/alchemy_cms.rb +7 -4
  68. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +3 -0
  69. data/lib/rails/generators/alchemy/elements/elements_generator.rb +5 -1
  70. data/lib/rails/generators/alchemy/page_layouts/page_layouts_generator.rb +1 -0
  71. data/lib/rails/generators/alchemy/scaffold/files/{pages.html.erb → application.html.erb} +0 -0
  72. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +11 -20
  73. data/lib/rails/templates/alchemy.rb +1 -7
  74. data/lib/tasks/{database.rake → alchemy/db.rake} +1 -1
  75. data/lib/tasks/{install.rake → alchemy/install.rake} +9 -14
  76. data/lib/tasks/{upgrade.rake → alchemy/upgrade.rake} +1 -1
  77. data/spec/controllers/elements_controller_spec.rb +24 -9
  78. data/spec/controllers/pictures_controller_spec.rb +11 -8
  79. data/{app → spec/dummy/app}/views/alchemy/elements/_article_editor.html.erb +0 -0
  80. data/{app → spec/dummy/app}/views/alchemy/elements/_article_view.html.erb +0 -0
  81. data/{app → spec/dummy/app}/views/alchemy/elements/_headline_view.html.erb +0 -0
  82. data/{app → spec/dummy/app}/views/alchemy/elements/_news_view.html.erb +0 -0
  83. data/{app → spec/dummy/app}/views/alchemy/elements/_searchresult_view.html.erb +0 -0
  84. data/{app → spec/dummy/app}/views/alchemy/page_layouts/_standard.html.erb +0 -0
  85. data/spec/dummy/config/alchemy/elements.yml +86 -0
  86. data/spec/dummy/config/alchemy/page_layouts.yml +26 -0
  87. data/spec/dummy/config/application.rb +1 -1
  88. data/spec/dummy/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +21 -0
  89. data/spec/dummy/db/migrate/20121205155004_create_alchemy_sites.rb +14 -0
  90. data/spec/dummy/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +6 -0
  91. data/spec/dummy/db/schema.rb +21 -6
  92. data/spec/factories.rb +6 -2
  93. data/spec/integration/translation_integration_spec.rb +4 -18
  94. data/spec/models/element_spec.rb +4 -4
  95. data/spec/models/picture_spec.rb +37 -20
  96. data/spec/models/site_spec.rb +69 -0
  97. data/spec/routing_spec.rb +115 -115
  98. data/spec/spec_helper.rb +1 -3
  99. data/spec/support/alchemy/specs_helpers.rb +4 -4
  100. data/vendor/assets/javascripts/jquery_plugins/jquery.html5uploader.js +1 -1
  101. metadata +72 -96
  102. data/app/assets/stylesheets/alchemy/standard_set.css +0 -440
  103. data/app/views/alchemy/elements/_bild_editor.html.erb +0 -1
  104. data/app/views/alchemy/elements/_bild_text_editor.html.erb +0 -7
  105. data/app/views/alchemy/elements/_bild_text_view.html.erb +0 -9
  106. data/app/views/alchemy/elements/_bild_view.html.erb +0 -9
  107. data/app/views/alchemy/elements/_claim_editor.html.erb +0 -1
  108. data/app/views/alchemy/elements/_claim_view.html.erb +0 -1
  109. data/app/views/alchemy/elements/_contactform_editor.html.erb +0 -4
  110. data/app/views/alchemy/elements/_contactform_view.html.erb +0 -78
  111. data/app/views/alchemy/elements/_download_editor.html.erb +0 -4
  112. data/app/views/alchemy/elements/_download_view.html.erb +0 -7
  113. data/app/views/alchemy/elements/_footnote_editor.html.erb +0 -1
  114. data/app/views/alchemy/elements/_footnote_view.html.erb +0 -5
  115. data/app/views/alchemy/elements/_header_editor.html.erb +0 -1
  116. data/app/views/alchemy/elements/_header_view.html.erb +0 -1
  117. data/app/views/alchemy/elements/_headline_editor.html.erb +0 -1
  118. data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +0 -3
  119. data/app/views/alchemy/elements/_image_mosaic_view.html.erb +0 -14
  120. data/app/views/alchemy/elements/_intro_editor.html.erb +0 -1
  121. data/app/views/alchemy/elements/_intro_image_text_editor.html.erb +0 -3
  122. data/app/views/alchemy/elements/_intro_image_text_view.html.erb +0 -16
  123. data/app/views/alchemy/elements/_intro_view.html.erb +0 -3
  124. data/app/views/alchemy/elements/_news_editor.html.erb +0 -3
  125. data/app/views/alchemy/elements/_searchresult_editor.html.erb +0 -4
  126. data/app/views/alchemy/elements/_sitemap_editor.html.erb +0 -3
  127. data/app/views/alchemy/elements/_sitemap_view.html.erb +0 -38
  128. data/app/views/alchemy/elements/_sitename_editor.html.erb +0 -1
  129. data/app/views/alchemy/elements/_sitename_view.html.erb +0 -1
  130. data/app/views/alchemy/elements/_subheadline_editor.html.erb +0 -1
  131. data/app/views/alchemy/elements/_subheadline_view.html.erb +0 -5
  132. data/app/views/alchemy/elements/_text_editor.html.erb +0 -1
  133. data/app/views/alchemy/elements/_text_view.html.erb +0 -3
  134. data/app/views/alchemy/page_layouts/_contact.html.erb +0 -14
  135. data/app/views/alchemy/page_layouts/_external.html.erb +0 -0
  136. data/app/views/alchemy/page_layouts/_intro.html.erb +0 -14
  137. data/app/views/alchemy/page_layouts/_layout_footer.html.erb +0 -14
  138. data/app/views/alchemy/page_layouts/_layout_header.html.erb +0 -14
  139. data/app/views/alchemy/page_layouts/_news.html.erb +0 -14
  140. data/app/views/alchemy/page_layouts/_newsletter_layout.html.erb +0 -1
  141. data/app/views/alchemy/page_layouts/_search.html.erb +0 -14
  142. data/app/views/alchemy/pictures/show.gif.flexi +0 -19
  143. data/app/views/alchemy/pictures/show.jpg.flexi +0 -19
  144. data/app/views/alchemy/pictures/show.png.flexi +0 -19
  145. data/app/views/alchemy/pictures/thumbnail.png.flexi +0 -13
  146. data/app/views/alchemy/pictures/zoom.jpg.flexi +0 -3
  147. data/app/views/alchemy/pictures/zoom.png.flexi +0 -3
  148. data/app/views/layouts/alchemy/pages.html.erb +0 -51
  149. data/config/alchemy/elements.yml +0 -274
  150. data/config/alchemy/page_layouts.yml +0 -75
  151. data/config/asset_packages.yml +0 -30
  152. data/config/initializers/localeapp.rb +0 -9
  153. data/lib/rails/generators/alchemy/plugin/files/translation.pot +0 -3
  154. data/lib/rails/generators/alchemy/plugin/files/translation_de.po +0 -3
  155. data/lib/rails/generators/alchemy/plugin/files/translation_en.po +0 -3
  156. data/lib/rails/generators/alchemy/plugin/plugin_generator.rb +0 -37
  157. data/lib/rails/generators/alchemy/plugin/templates/authorization_rules.rb +0 -34
  158. data/lib/rails/generators/alchemy/plugin/templates/config.yml +0 -30
  159. data/lib/rails/generators/alchemy/plugin/templates/init.rb +0 -1
  160. data/lib/rails/generators/alchemy/plugin/templates/plugin.rb +0 -0
  161. data/lib/rails/generators/alchemy/plugin/templates/routes.rb +0 -10
  162. data/lib/tasks/fleximage.rake +0 -154
  163. data/spec/dummy/app/views/layouts/.gitkeep +0 -0
@@ -1,14 +1,8 @@
1
- require 'alchemy/version'
2
1
  # This rails template installs Alchemy and all depending gems.
3
-
4
- # Installing Alchemy Gem
2
+ require 'alchemy/version'
5
3
 
6
4
  gem 'alchemy_cms', "~> #{Alchemy::VERSION}"
7
- gem 'ruby-debug', :group => :development, :platform => :ruby_18
8
- gem 'debugger', :group => :development, :platform => :ruby_19
9
5
 
10
6
  if yes?("\nDo you want to use Capistrano for deployment? (y/N)")
11
7
  gem 'capistrano', :group => :development
12
8
  end
13
-
14
- run 'bundle install'
@@ -6,7 +6,7 @@ namespace :alchemy do
6
6
  Alchemy::Seeder.seed!
7
7
  end
8
8
 
9
- desc "Dumps the database into 'db/dumps'"
9
+ desc "Dumps the database into 'db/dumps'. NOTE: This only works with MySQL yet."
10
10
  task :dump => :environment do
11
11
  db_conf = Rails.configuration.database_configuration.fetch(Rails.env)
12
12
  raise "Alchemy only supports MySQL database dumping at the moment." unless db_conf['adapter'] =~ /mysql/
@@ -19,6 +19,7 @@ namespace :alchemy do
19
19
 
20
20
  desc "Installs Alchemy CMS into your app."
21
21
  task :install do
22
+ Rake::Task["db:create"].invoke
22
23
  Rake::Task["alchemy:install:migrations"].invoke
23
24
  Rake::Task["alchemy:mount"].invoke
24
25
  system("rails g alchemy:scaffold")
@@ -28,7 +29,7 @@ namespace :alchemy do
28
29
 
29
30
  \\o/ Successfully installed Alchemy CMS \\o/
30
31
 
31
- Now:
32
+ Now cd into your app folder and
32
33
 
33
34
  1. Start your Rails server:
34
35
 
@@ -36,10 +37,16 @@ Now:
36
37
 
37
38
  2. Open your browser and enter the following URL:
38
39
 
39
- http://localhost:3000/#{@mountpoint == '/' ? '' : @mountpoint}/admin/signup
40
+ http://localhost:3000/#{@mountpoint}
40
41
 
41
42
  3. Follow the instructions to complete the installation!
42
43
 
44
+ == First time Alchemy user?
45
+
46
+ Then we recommend to install the Alchemy demo kit.
47
+
48
+ Just add `gem "alchemy-demo_kit"` to your apps Gemfile and run `bundle install`.
49
+
43
50
  Thank you for using Alchemy CMS!
44
51
 
45
52
  http://alchemy-cms.com/
@@ -52,16 +59,4 @@ EOF
52
59
  Alchemy::RoutesInjector.new.inject
53
60
  end
54
61
 
55
- namespace :standard_set do
56
-
57
- desc "Install Alchemy CMS's standard set."
58
- task :install do
59
- system("rails g alchemy:scaffold --with-standard-set")
60
- puts "\n-> Please do not forget to add Alchemy's standard set to precompiable assets. <-\n"
61
- puts "\nPut this line in your 'config/environments/production.rb' file:\n"
62
- puts " config.assets.precompile += %w( alchemy/standard_set.css )"
63
- end
64
-
65
- end
66
-
67
62
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), '../alchemy/upgrader.rb')
1
+ require File.join(File.dirname(__FILE__), '../../alchemy/upgrader.rb')
2
2
 
3
3
  namespace :alchemy do
4
4
 
@@ -3,29 +3,44 @@ require 'spec_helper'
3
3
  module Alchemy
4
4
  describe ElementsController do
5
5
 
6
- let(:page) { FactoryGirl.create(:public_page, :restricted => true) }
7
- let(:element) { FactoryGirl.create(:element, :page => page, :name => 'download') }
6
+ let(:page) { FactoryGirl.create(:public_page) }
7
+ let(:element) { FactoryGirl.create(:element, :page => page, :name => 'download') }
8
+ let(:restricted_page) { FactoryGirl.create(:public_page, :restricted => true) }
9
+ let(:restricted_element) { FactoryGirl.create(:element, :page => restricted_page, :name => 'download') }
8
10
 
9
11
  describe '#show' do
10
12
 
11
- it "should not return restricted elements" do
13
+ it "should render available elements" do
12
14
  get :show, :id => element.id
13
- response.status.should == 302
14
- response.should redirect_to(login_path)
15
+ response.status.should == 200
15
16
  end
16
17
 
17
- context "for registered user" do
18
+ it "should raise ActiveRecord::RecordNotFound error for trashed elements" do
19
+ element.trash
20
+ expect { get(:show, :id => element.id) }.to raise_error(ActiveRecord::RecordNotFound)
21
+ end
18
22
 
23
+ it "should raise ActiveRecord::RecordNotFound error for unpublished elements" do
24
+ element.update_attributes(:public => false)
25
+ expect { get(:show, :id => element.id) }.to raise_error(ActiveRecord::RecordNotFound)
26
+ end
27
+
28
+ context "for guest user" do
29
+ it "should raise ActiveRecord::RecordNotFound error for elements of restricted pages" do
30
+ expect { get(:show, :id => restricted_element.id) }.to raise_error(ActiveRecord::RecordNotFound)
31
+ end
32
+ end
33
+
34
+ context "for registered user" do
19
35
  before do
20
36
  activate_authlogic
21
37
  UserSession.create(FactoryGirl.create(:registered_user))
22
38
  end
23
39
 
24
- it "should render restricted elements" do
25
- get :show, :id => element.id
40
+ it "should render elements of restricted pages" do
41
+ get :show, :id => restricted_element.id
26
42
  response.status.should == 200
27
43
  end
28
-
29
44
  end
30
45
 
31
46
  end
@@ -22,7 +22,6 @@ module Alchemy
22
22
  end
23
23
 
24
24
  context "Requesting a picture that is assigned on restricted and non-restricted pages" do
25
-
26
25
  before do
27
26
  essence = element.contents.where(:name => 'image').first.essence
28
27
  essence.picture_id = picture.id
@@ -39,11 +38,9 @@ module Alchemy
39
38
  response.status.should == 200
40
39
  end
41
40
  end
42
-
43
41
  end
44
42
 
45
43
  context "Requesting a picture that is assigned with restricted pages only" do
46
-
47
44
  before do
48
45
  essence = restricted_element.contents.where(:name => 'image').first.essence
49
46
  essence.picture_id = picture.id
@@ -51,17 +48,14 @@ module Alchemy
51
48
  end
52
49
 
53
50
  context "as guest user" do
54
-
55
51
  it "should not render the picture, but redirect to login path" do
56
52
  get :show, :id => picture.id, :sh => picture.security_token
57
53
  response.status.should == 302
58
54
  response.should redirect_to(login_path)
59
55
  end
60
-
61
56
  end
62
57
 
63
58
  context "as registered user" do
64
-
65
59
  before do
66
60
  activate_authlogic
67
61
  UserSession.create(FactoryGirl.create(:registered_user))
@@ -71,10 +65,19 @@ module Alchemy
71
65
  get :show, :id => picture.id, :format => :png, :sh => picture.security_token
72
66
  response.status.should == 200
73
67
  end
74
-
75
68
  end
69
+ end
76
70
 
77
-
71
+ context "Requesting a picture with crop and size parameters" do
72
+ it "should render a cropped image" do
73
+ options = {
74
+ :crop => 'crop',
75
+ :size => '10x10',
76
+ :format => 'png'
77
+ }
78
+ get :show, options.merge(:id => picture.id, :sh => picture.security_token(options))
79
+ response.body[0x10..0x18].unpack('NN').should == [10,10]
80
+ end
78
81
  end
79
82
 
80
83
 
@@ -0,0 +1,86 @@
1
+ - name: header
2
+ unique: true
3
+ contents:
4
+ - name: image
5
+ type: EssencePicture
6
+
7
+ - name: headline
8
+ contents:
9
+ - name: headline
10
+ type: EssenceText
11
+
12
+ - name: article
13
+ taggable: true
14
+ contents:
15
+ - name: intro
16
+ type: EssenceText
17
+ - name: headline
18
+ type: EssenceText
19
+ settings:
20
+ deletable: true
21
+ - name: image
22
+ type: EssencePicture
23
+ - name: text
24
+ type: EssenceRichtext
25
+ settings:
26
+ deletable: true
27
+ available_contents:
28
+ - name: text
29
+ type: EssenceRichtext
30
+ - name: headline
31
+ type: EssenceText
32
+
33
+ - name: text
34
+ contents:
35
+ - name: text
36
+ type: EssenceRichtext
37
+
38
+ - name: news
39
+ contents:
40
+ - name: date
41
+ type: EssenceDate
42
+ - name: news_headline
43
+ type: EssenceText
44
+ rss_title: true
45
+ - name: body
46
+ type: EssenceRichtext
47
+ rss_description: true
48
+
49
+ - name: download
50
+ contents:
51
+ - name: file
52
+ type: EssenceFile
53
+ settings:
54
+ deletable: true
55
+ available_contents:
56
+ - name: file
57
+ type: EssenceFile
58
+
59
+ - name: bild
60
+ contents:
61
+ - name: image
62
+ type: EssencePicture
63
+
64
+ - name: contactform
65
+ unique: true
66
+ contents:
67
+ - name: mail_from
68
+ type: EssenceText
69
+ validate:
70
+ - presence
71
+ - name: mail_to
72
+ type: EssenceText
73
+ validate:
74
+ - presence
75
+ - name: subject
76
+ type: EssenceText
77
+ take_me_for_preview: true
78
+ validate:
79
+ - presence
80
+ - name: success_page
81
+ type: EssenceSelect
82
+ validate:
83
+ - presence
84
+
85
+ - name: searchresult
86
+ unique: true
@@ -0,0 +1,26 @@
1
+ - name: intro
2
+ unique: true
3
+
4
+ - name: standard
5
+ elements: [article, header]
6
+ autogenerate: [header, article]
7
+
8
+ - name: news
9
+ feed: true
10
+ unique: true
11
+ insert_elements_at: top
12
+ elements: [headline, news]
13
+ autogenerate: [news]
14
+ feed_elements: [news]
15
+
16
+ - name: contact
17
+ unique: true
18
+ cache: false
19
+ elements: [headline, text, contactform]
20
+ autogenerate: [headline, text, contactform]
21
+
22
+ - name: search
23
+ unique: true
24
+ elements: [headline, text, searchresult]
25
+ autogenerate: [searchresult]
26
+ searchresults: true
@@ -37,7 +37,7 @@ module Dummy
37
37
 
38
38
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
39
39
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
40
- config.i18n.default_locale = :en
40
+ # config.i18n.default_locale = :de
41
41
 
42
42
  # Configure the default encoding used in templates for Ruby 1.9.
43
43
  config.encoding = "utf-8"
@@ -0,0 +1,21 @@
1
+ class SwitchFromFleximageToDragonfly < ActiveRecord::Migration
2
+ def up
3
+ change_table :alchemy_pictures do |t|
4
+ t.string :image_file_uid
5
+ t.integer :image_file_size
6
+ t.rename :image_width, :image_file_width
7
+ t.rename :image_height, :image_file_height
8
+ t.rename :image_filename, :image_file_name
9
+ end
10
+ end
11
+
12
+ def down
13
+ change_table :alchemy_pictures do |t|
14
+ t.remove :image_file_uid
15
+ t.remove :image_file_size
16
+ t.rename :image_file_width, :image_width
17
+ t.rename :image_file_height, :image_height
18
+ t.rename :image_file_name, :image_filename
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,14 @@
1
+ class CreateAlchemySites < ActiveRecord::Migration
2
+ def change
3
+ create_table "alchemy_sites" do |t|
4
+ t.string :host
5
+ t.string :name
6
+ t.timestamps
7
+ end
8
+ add_index :alchemy_sites, :host, uniq: true
9
+
10
+ # add Language#site_id
11
+ add_column :alchemy_languages, :site_id, :integer
12
+ add_index :alchemy_languages, :site_id
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ class AddPublicToAlchemySites < ActiveRecord::Migration
2
+ def change
3
+ add_column :alchemy_sites, :public, :boolean, :default => false
4
+ add_index :alchemy_sites, [:host, :public], :name => 'alchemy_sites_public_hosts_idx'
5
+ end
6
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20121116141016) do
14
+ ActiveRecord::Schema.define(:version => 20121211163003) do
15
15
 
16
16
  create_table "alchemy_attachments", :force => true do |t|
17
17
  t.string "name"
@@ -187,10 +187,12 @@ ActiveRecord::Schema.define(:version => 20121116141016) do
187
187
  t.integer "updater_id"
188
188
  t.boolean "default", :default => false
189
189
  t.string "country_code", :default => "", :null => false
190
+ t.integer "site_id"
190
191
  end
191
192
 
192
193
  add_index "alchemy_languages", ["language_code", "country_code"], :name => "index_alchemy_languages_on_language_code_and_country_code"
193
194
  add_index "alchemy_languages", ["language_code"], :name => "index_alchemy_languages_on_language_code"
195
+ add_index "alchemy_languages", ["site_id"], :name => "index_alchemy_languages_on_site_id"
194
196
 
195
197
  create_table "alchemy_pages", :force => true do |t|
196
198
  t.string "name"
@@ -228,17 +230,30 @@ ActiveRecord::Schema.define(:version => 20121116141016) do
228
230
 
229
231
  create_table "alchemy_pictures", :force => true do |t|
230
232
  t.string "name"
231
- t.string "image_filename"
232
- t.integer "image_width"
233
- t.integer "image_height"
234
- t.datetime "created_at", :null => false
235
- t.datetime "updated_at", :null => false
233
+ t.string "image_file_name"
234
+ t.integer "image_file_width"
235
+ t.integer "image_file_height"
236
+ t.datetime "created_at", :null => false
237
+ t.datetime "updated_at", :null => false
236
238
  t.integer "creator_id"
237
239
  t.integer "updater_id"
238
240
  t.string "upload_hash"
239
241
  t.text "cached_tag_list"
242
+ t.string "image_file_uid"
243
+ t.integer "image_file_size"
244
+ end
245
+
246
+ create_table "alchemy_sites", :force => true do |t|
247
+ t.string "host"
248
+ t.string "name"
249
+ t.datetime "created_at", :null => false
250
+ t.datetime "updated_at", :null => false
251
+ t.boolean "public", :default => false
240
252
  end
241
253
 
254
+ add_index "alchemy_sites", ["host", "public"], :name => "alchemy_sites_public_hosts_idx"
255
+ add_index "alchemy_sites", ["host"], :name => "index_alchemy_sites_on_host"
256
+
242
257
  create_table "alchemy_users", :force => true do |t|
243
258
  t.string "firstname"
244
259
  t.string "lastname"
@@ -5,7 +5,6 @@ FactoryGirl.define do
5
5
  login "jdoe"
6
6
  password 's3cr3t'
7
7
  password_confirmation 's3cr3t'
8
- language 'en'
9
8
 
10
9
  factory :admin_user do
11
10
  role "admin"
@@ -32,6 +31,7 @@ FactoryGirl.define do
32
31
  frontpage_name 'Intro'
33
32
  page_layout 'intro'
34
33
  public true
34
+ site { Alchemy::Site.first }
35
35
 
36
36
  factory :klingonian do
37
37
  name 'Klingonian'
@@ -94,7 +94,7 @@ FactoryGirl.define do
94
94
  factory :picture, :class => 'Alchemy::Picture' do
95
95
  image_file File.new(File.expand_path('../support/image.png', __FILE__))
96
96
  name 'image'
97
- image_filename 'image.png'
97
+ image_file_name 'image.png'
98
98
  upload_hash Time.now.hash
99
99
  end
100
100
 
@@ -108,4 +108,8 @@ FactoryGirl.define do
108
108
  entrance_fee 12.3
109
109
  end
110
110
 
111
+ factory :site, class: 'Alchemy::Site' do
112
+ name 'A Site'
113
+ host 'domain.com'
114
+ end
111
115
  end