comfortable_mexican_sofa 1.0.21 → 1.0.22

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.21
1
+ 1.0.22
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{comfortable_mexican_sofa}
8
- s.version = "1.0.21"
8
+ s.version = "1.0.22"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oleg Khabarov", "The Working Group Inc"]
@@ -20,6 +20,10 @@ namespace :comfortable_mexican_sofa do
20
20
  if !(@site = CmsSite.find_by_hostname(args[:to]))
21
21
  abort "TO is not properly set. Cannot find site with hostname '#{args[:to]}'"
22
22
  end
23
+
24
+ # a small hack to ensure that #load_from_file looks in the right directory
25
+ @site.hostname = args[:from]
26
+
23
27
  puts "Starting import into #{@site.label} (#{@site.hostname}) from '#{@seed_path}'"
24
28
  end
25
29
 
@@ -30,8 +34,8 @@ namespace :comfortable_mexican_sofa do
30
34
  layouts = Dir.glob(File.expand_path('layouts/*.yml', @seed_path)).collect do |layout_file_path|
31
35
  attributes = YAML.load_file(layout_file_path).symbolize_keys!
32
36
  @site.cms_layouts.load_from_file(@site, attributes[:slug])
33
- end
34
- CmsPage.connection.transaction do
37
+ end.compact
38
+ CmsLayout.connection.transaction do
35
39
  # Fixtures are not ordered in any particular way. Saving order matters,
36
40
  # so we cycle them until there nothing left to save
37
41
  while layouts.present?
@@ -69,7 +73,7 @@ namespace :comfortable_mexican_sofa do
69
73
  pages = Dir.glob(File.expand_path('pages/**/*.yml', @seed_path)).collect do |page_file_path|
70
74
  attributes = YAML.load_file(page_file_path).symbolize_keys!
71
75
  @site.cms_pages.load_from_file(@site, attributes[:full_path])
72
- end
76
+ end.compact
73
77
  CmsPage.connection.transaction do
74
78
  # Fixtures are not ordered in any particular way. Saving order matters,
75
79
  # so we cycle them until there nothing left to save
@@ -118,7 +122,7 @@ namespace :comfortable_mexican_sofa do
118
122
  snippets = Dir.glob(File.expand_path('snippets/*.yml', @seed_path)).collect do |snippet_file_path|
119
123
  attributes = YAML.load_file(snippet_file_path).symbolize_keys!
120
124
  @site.cms_snippets.load_from_file(@site, attributes[:slug])
121
- end
125
+ end.compact
122
126
  CmsSnippet.connection.transaction do
123
127
  snippets.each do |snippet|
124
128
  should_write = true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 21
10
- version: 1.0.21
9
+ - 22
10
+ version: 1.0.22
11
11
  platform: ruby
12
12
  authors:
13
13
  - Oleg Khabarov