Sha256: 7e5a9822c9ffc5dffbf17ee9f54403a31d4f4cc5277735d068e385f9b500987d

Contents?: true

Size: 316 Bytes

Versions: 16

Compression:

Stored size: 316 Bytes

Contents

class PopulateProfilesForExistingParticipants < ActiveRecord::Migration
  def change
    Participant.all.each do |participant|
      if !SocialNetworking::Profile.where(participant_id: participant.id)
        SocialNetworking::Profile.create(participant_id: participant.id, active: true)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
social_networking-0.13.3 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.13.2 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.13.1 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.13.0 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.12.0 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.8 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.7 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.6 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.5 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.4 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.3 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.2 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.1 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.11.0 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.10.0 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb
social_networking-0.9.3 db/migrate/20140917151905_populate_profiles_for_existing_participants.rb