It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.
I've also compiled a list of countries
It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.
I've also compiled a list of countries
class MoveAttachmentsToNewLocation < ActiveRecord::Migration | |
def initialize(name = self.class.name, version = nil) | |
access_key = Rails.application.secrets.g3_access_key_id | |
secret_key = Rails.application.secrets.g3_secret_access_key | |
storage = Fog::Storage::Google.new google_storage_access_key_id: access_key, | |
google_storage_secret_access_key: secret_key | |
@bucket_name = Rails.application.secrets.g3_bucket | |
@bucket = storage.directories.get(@bucket_name) | |
super(name, version) |
# frozen_string_literal: true | |
module ModelSupportsBulkUpdates | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Performs a bulk update with an efficient single query for all the records in the list. | |
# Note that the records are not reloaded form the database. | |
# This means that ActiveRecord will still see these records as dirty after the bulk_update. | |
def bulk_update(records) |