Sha256: d9ab494bc9647fd1b25705248ebb7a4ae64a88d62ad944dd30ebec2f93fb9803
Contents?: true
Size: 979 Bytes
Versions: 13
Compression:
Stored size: 979 Bytes
Contents
def insert_user User.truncate_table Role.truncate_table password = Devise.friendly_token admin = User.new(:name=>'Administrator', :email=>'dev@aimbulance.com', :password=>password, :password_confirmation=>password) admin.login = 'admin' if admin.respond_to?(:login) admin.roles.build(:role_type => RoleType.admin) admin.skip_confirmation! admin.save! puts "Admin: #{admin.email}, #{admin.password}" end def insert_structures Structure.truncate_table main_page = Structure.create!(:title => "Главная страница", :slug => "main-page", :structure_type => StructureType.main, :parent => nil) #Structure.create!(:title => "Трансляции", :slug => "broadcasts", :structure_type => StructureType.broadcasts, :parent => main_page) #Structure.create!(:title => "Прямые репортажи", :slug => "posts", :structure_type => StructureType.posts, :parent => main_page) end insert_user insert_structures
Version data entries
13 entries across 13 versions & 4 rubygems