# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) # uncomment after Role migration has bee create roles = Role.create([{name: "Admin User"}, {name: "Program User"}]) admin_user = Admin.new admin_user.email = "admin@albertmckeever.com" admin_user.password = "adminpwd$28" admin_user.admin_types = "admin" admin_user.save #create first admin Admin.create(email: 'akmckeev@albertmckeever.com', password: "Testing123", admin_types: "admin" ) Locale.create(name: 'English', short_name: 'en', description: 'American English') unless Locale.where("short_name = ?", "en").any? Locale.create(name: 'Spanish', short_name: 'es', description: 'Espanol') unless Locale.where("short_name = ?", "es").any? today_day = Date.today.day today_month = Date.today.month seed_program = Program.new seed_program.name = "Albert McKeever Program #{today_month}-#{today_day}" seed_program.locale = "en" Locale.all.each do |l| seed_program.locales << l end seed_program.sub_domain = "raffle" # "akm#{today_month}#{today_day}" seed_program.vanity_domain = "raffle.#{Phoenixv2::Application.config.app_domain}" #"akm#{today_month}#{today_day}.#{Phoenixv2::Application.config.app_domain}" seed_program.user_timeout = 20 seed_program.use_user_timeout = true seed_program.use_failed_login_attempts = true seed_program.locked_time = 5 seed_program.password_expirable = true seed_program.expiration_duration = 2 seed_program.enable_password_notifier = true seed_program.password_notifier = 1 seed_program.password_strength = 'good' seed_program.use_security_questions = true seed_program.num_security_questions = 1 seed_program.use_password_reuse_rules = true seed_program.password_reuse_rules = 1 seed_program.user_requirements = "---\n- work_state\n- date_of_birth\n" seed_program.search_fields = "---\n- email\n" if !(Program.find_by_sub_domain(seed_program.sub_domain).present?) seed_program.save!# rescue nil end program = Program.find_by_sub_domain ("raffle") #("akm#{today_month}#{today_day}") #::AppHelper.current_program = program term = TermsAndCondition.new( title: 'Albert McKeever T&Cs', akm_content: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC.', content: 'Customer: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC.', accept_text: 'I do accept the T&Cs', decline_text: 'I don\'t accept the T&Cs', decline_message: 'If you change your mind then contact your Program Coordinator to allow you to try again!', active: true, force_accept: true, program_id: program.id ) #term.translations.build( #locale: "albertmckeever_test_#{today_month}-#{today_day}_en", #title: 'Alber McKeever T&Cs', #akm_content: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC.', #content: 'Customer: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC.', #accept_text: 'I do accept the T&Cs', #decline_text: 'I don\'t accept the T&Cs', #decline_message: 'If you change your mind then contact your Program Coordinator to allow you to try again!' #) term.save!