Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
# frozen_string_literal: true
# rubocop:disable Rails/Output
require "factory_bot_rails"
rescue FactoryBot::DuplicateDefinitionError
# necessary to be able to use the rake db:seed task where we want, argh
Rails.logger.debug "Factory Girl definitions previously loaded"
organization = FactoryBot.create(:organization, name: "Acme Museum")
resource_groups = organization.resource_groups.create!([
{name: "collection"},
{name: "website"},
{name: "exhibitions"},
{name: "events"},
FactoryBot.factories[:license] do |trait|
rescue ActiveRecord::RecordInvalid
resource = FactoryBot.create(:resource, {
name: "T.Y.F.F.S.H., 2011",
organization: organization,
resource_groups: [resource_groups.first],
source_uri: "",
alt_text = "A red, white, and blue fabric canopy presses against walls of room; portable fans blow air into the room through a doorway."
long_text = <<~TEXT
This is an installation that viewers are invited to walk inside of. From this viewpoint you are looking through a doorway at a slight distance,
as if standing inside of a large cave and looking out of its narrow entrance at the world outside. The walls of this cave are alternating stripes of
red, white, and blue material that seems to be made of some kind of thin fabric. These colored stripes spiral around toward the entrance, as if
being sucked out of the opening. The inside of the cave is more shadowed and the area outside is brightly lit. Gradually you notice that there
are in fact two openings lined up in front of each other, straight ahead of you: the first one is a tall rectangle—the red, white and blue fabric
is wrapped through the edges of a standard doorway; beyond that it continues to spiral around toward another circular opening. The center of
this circle is much brighter, as if one had finally escape from the cave. At the center of that circular opening you see two large white fans
facing your direction, blowing air into the cave-like opening. Beyond the fans you see a brown, square form, which is the bottom of a
huge wicker basket. This basket, lying on its side, helps to reveal the truth about what you are seeing: You are standing inside of a huge
hot air balloon, which is lying on its side. Blown by the fans, the fabric billows out to press out against the existing walls of a large room,
the malleable shape of the balloon conforming to the rectangular surfaces of an existing building–the gallery that contains it.
FactoryBot.create(:representation, resource: resource, metum: organization.meta.first, text: alt_text)
FactoryBot.create(:representation, resource: resource, metum: organization.meta.last, text: long_text)
undescribed_resource = FactoryBot.create(:resource, {
name: "Installation view, _The Making of A Fugitive_, MCA Chicago, Jul 16–Dec 4,2016",
organization: organization,
source_uri: "",
# undescribed, unassigned resource
FactoryBot.create(:resource, {
name: "Unknown",
organization: organization,
source_uri: "",
Coyote::Membership.each_role do |_, role_id|
email = "#{role_id}"
user = FactoryBot.create(:user, organization: organization, role: role_id, email: email, password: "password")
Assignment.create(resource: undescribed_resource, user: user)
puts "Created #{role_id} user '#{email}' with password 'password'"
email = ""
FactoryBot.create(:user, :staff, email: email, password: "password")
puts "Created staff user '#{email}' with password 'password'"
# rubocop:enable Rails/Output