Skip to content
Snippets Groups Projects
Commit 55fc4945 authored by pabois's avatar pabois
Browse files

add migration

parent 43070274
No related branches found
No related tags found
No related merge requests found
class CreateDefaultFavorites < ActiveRecord::Migration[7.0]
def up
User.not_visitor.not_contributor.not_author.not_teacher.not_program_manager.each do |user|
return if user.favorites.any?
return if user.university.websites.many?
user.favorites.create(about: user.university.websites.first)
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment