Permalink
Browse files

Fit issue 240 by using slug to find content-type

export.rb exports targets with
field_attributes['target'] = target_klass._parent.slug
but import imports it with:
target_content_type = site.content_types.where(:name => association.target).first

this fails if one uses capitalized names for Models.
i changed the default.zip to contain a site yaml with capitalized
Model-Names too.
  • Loading branch information...
1 parent a650acd commit 27dd3b2001a2e022ee33fede34bbb98152780946 @paulsponagl paulsponagl committed Jan 9, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/locomotive/import/content_types.rb
  2. BIN spec/fixtures/themes/default.zip
@@ -189,7 +189,7 @@ def insert_samples_with_associations(contents)
content = content._parent.reload.contents.find(content._id) # target should be updated
associations.each do |association|
- target_content_type = site.content_types.where(:name => association.target).first
+ target_content_type = site.content_types.where(:slug => association.target).first
next if target_content_type.nil?
@@ -240,4 +240,4 @@ def set_group_by_value(content_type)
end
end
-end
+end
Binary file not shown.

0 comments on commit 27dd3b2

Please sign in to comment.