Sha256: 49d62c69da095a2f1867c296d5d4d3e409616a3d623309772a3d46493e532b27

Contents?: true

Size: 401 Bytes

Versions: 9

Compression:

Stored size: 401 Bytes

Contents

users = [
	{email: 'admin@example.com', password: 'password', password_confirmation: 'password'}
]

users.each do |user|
  db_user = AdminUser.where(email: user[:email]).first_or_initialize(user)
  if db_user.valid?
   	if db_user.new_record?
    	db_user.save!
    else
    	db_user.update_attributes! user
    end
    puts "User #{db_user.email} updated with password: #{db_user.password}"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
activeadmin_custom_layout-0.1.9 test/dummy/db/seeds.rb
activeadmin_custom_layout-0.1.8 test/dummy/db/seeds.rb
activeadmin_custom_layout-0.1.7 test/dummy/db/seeds.rb
activeadmin_custom_layout-0.1.6 test/dummy/db/seeds.rb
activeadmin_custom_layout-0.1.5 test/dummy/db/seeds.rb
activeadmin_custom_layout-0.1.4 test/dummy/db/seeds.rb
activeadmin_custom_layout-0.1.3 test/dummy/db/seeds.rb
activeadmin_custom_layout-0.1.1 test/dummy/db/seeds.rb
activeadmin_custom_layout-0.1.0 test/dummy/db/seeds.rb