Skip to content
Browse files

Merge pull request #23 from yury/xcversiongroup

Set path attribute on XCVersionGroup when creating with #new_xcdatamodel_group
  • Loading branch information...
2 parents d7806ab + 94edf02 commit 492af1120ca9d4e739dd4413b6c59a5338e3f975 @alloy alloy committed
Showing with 3 additions and 1 deletion.
  1. +2 −1 lib/xcodeproj/project/object/group.rb
  2. +1 −0 spec/project/object/group_spec.rb
View
3 lib/xcodeproj/project/object/group.rb
@@ -105,9 +105,10 @@ class XCVersionGroup < PBXGroup
attribute :version_group_type
attribute :current_version
+ attribute :path
def self.new_xcdatamodel_group(project, xcdatamodel_path)
- group = new(project, nil, 'versionGroupType' => 'wrapper.xcdatamodel')
+ group = new(project, nil, 'path' => xcdatamodel_path, 'versionGroupType' => 'wrapper.xcdatamodel')
file = group.files.new(
'path' => xcdatamodel_path.sub(/xcdatamodeld$/, 'xcdatamodel'),
'lastKnownFileType' => 'wrapper.xcdatamodel'
View
1 spec/project/object/group_spec.rb
@@ -121,6 +121,7 @@ module ProjectSpecs
file = @project.files[version_group.current_version]
version_group.files.should == [file]
file.path.should == 'some/Model.xcdatamodel'
+ version_group.path.should == 'some/Model.xcdatamodeld'
end
end
end

0 comments on commit 492af11

Please sign in to comment.
Something went wrong with that request. Please try again.