Method: GroupMixins::Import#import_default_group_structure
- Defined in:
- app/models/group_mixins/import.rb
#import_default_group_structure(yaml_file_title = nil) ⇒ Object
Import the default group structure. This is called after creation of the group.
The structure is to be placed in a file at
#{Rails.root}/import/default_group_sub_structures/#{self.name}.yml
and is to be formatted in yaml, like this:
- Group 1
- Group 2:
- Group 2.1:
- Group 2.1.1
- Group 2.1.2
- Group 2.2
- Group 3:
- Group 3.1
277 278 279 280 281 282 |
# File 'app/models/group_mixins/import.rb', line 277 def import_default_group_structure( yaml_file_title = nil ) yaml_file_title ||= yaml_file_title = File.join( "default_group_sub_structures", "#{self.name}.yml" ) parent_group = self Group.yaml_import_groups_into_parent_group( yaml_file_title, parent_group ) end |