Sha256: ef1ececae903d6ff3983b690fb506bcfbdbe714dc72f8b086c09ec99a9179242
Contents?: true
Size: 612 Bytes
Versions: 8
Compression:
Stored size: 612 Bytes
Contents
def insert_user User.truncate! password = Rails.env.production? ? Devise.friendly_token : (1..8).to_a.join admin = User.new do |u| u.email = 'admin@example.com' u.password = password u.password_confirmation = password u.user_role_id = UserRoleType.admin.id end admin.activate! admin.save! puts "Admin: #{admin.email}, #{admin.password}" end def insert_structures Structure.truncate! main_page = Structure.create!({title: 'Главная страница', slug: 'main-page', structure_type: StructureType.main, parent: nil}, as: :admin) end insert_user insert_structures
Version data entries
8 entries across 8 versions & 1 rubygems