Skip to content

Commit 46941c2

Browse files
authored
Merge pull request #680 from code-corps/remove-unused-arc-code
Remove unused arc code
2 parents 43fb81c + d54fbfb commit 46941c2

File tree

15 files changed

+93
-278
lines changed

15 files changed

+93
-278
lines changed

config/config.exs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ config :ex_aws, :code_corps,
4747
access_key_id: [System.get_env("AWS_ACCESS_KEY_ID"), :instance_role],
4848
secret_access_key: [System.get_env("AWS_SECRET_ACCESS_KEY"), :instance_role]
4949

50-
# Configures Arc for image uploads
51-
config :arc,
52-
bucket: System.get_env("S3_BUCKET"),
50+
config :code_corps,
5351
asset_host: System.get_env("CLOUDFRONT_DOMAIN")
5452

5553
config :segment,

lib/code_corps/helpers/cloudinary_url.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule CodeCorps.Helpers.CloudinaryUrl do
22

33
def for(nil, _options, version, default_color, type) do
4-
"#{Application.get_env(:arc, :asset_host)}/icons/#{type}_default_#{version}_#{default_color}.png"
4+
"#{Application.get_env(:code_corps, :asset_host)}/icons/#{type}_default_#{version}_#{default_color}.png"
55
end
66
def for(public_id, options, _version, _default_color, _type) do
77
Cloudex.Url.for(public_id, options)

mix.exs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ defmodule CodeCorps.Mixfile do
3131
:gettext,
3232
:phoenix_ecto,
3333
:postgrex,
34-
:arc_ecto,
3534
:cloudex,
3635
:comeonin,
3736
:corsica,
@@ -68,8 +67,6 @@ defmodule CodeCorps.Mixfile do
6867
{:phoenix_live_reload, "~> 1.0", only: :dev},
6968
{:gettext, "~> 0.12"},
7069
{:cowboy, "~> 1.0"},
71-
{:arc, "~> 0.6"}, # Photo uploads
72-
{:arc_ecto, "~> 0.5"},
7370
{:benchfella, "~> 0.3.0", only: :dev},
7471
{:canary, "~> 1.1"}, # Authorization
7572
{:cloudex, "~> 0.1.10"},

priv/repo/image_migration.exs

Lines changed: 0 additions & 105 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
defmodule CodeCorps.Repo.Migrations.RemovePhotoIconColumns do
2+
use Ecto.Migration
3+
4+
def change do
5+
alter table(:organizations) do
6+
remove :icon
7+
end
8+
9+
alter table(:projects) do
10+
remove :icon
11+
end
12+
13+
alter table(:users) do
14+
remove :photo
15+
end
16+
end
17+
end

priv/repo/structure.sql

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ CREATE TABLE organizations (
195195
slug character varying(255) NOT NULL,
196196
inserted_at timestamp without time zone NOT NULL,
197197
updated_at timestamp without time zone NOT NULL,
198-
icon character varying(255),
199198
approved boolean DEFAULT false,
200199
cloudinary_public_id character varying(255),
201200
default_color character varying(255)
@@ -332,7 +331,6 @@ CREATE TABLE projects (
332331
organization_id integer NOT NULL,
333332
inserted_at timestamp without time zone NOT NULL,
334333
updated_at timestamp without time zone NOT NULL,
335-
icon character varying(255),
336334
total_monthly_donated integer DEFAULT 0,
337335
approved boolean DEFAULT false,
338336
cloudinary_public_id character varying(255),
@@ -1066,6 +1064,38 @@ CREATE SEQUENCE task_lists_id_seq
10661064
ALTER SEQUENCE task_lists_id_seq OWNED BY task_lists.id;
10671065

10681066

1067+
--
1068+
-- Name: task_skills; Type: TABLE; Schema: public; Owner: -
1069+
--
1070+
1071+
CREATE TABLE task_skills (
1072+
id integer NOT NULL,
1073+
skill_id integer NOT NULL,
1074+
task_id integer NOT NULL,
1075+
inserted_at timestamp without time zone NOT NULL,
1076+
updated_at timestamp without time zone NOT NULL
1077+
);
1078+
1079+
1080+
--
1081+
-- Name: task_skills_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1082+
--
1083+
1084+
CREATE SEQUENCE task_skills_id_seq
1085+
START WITH 1
1086+
INCREMENT BY 1
1087+
NO MINVALUE
1088+
NO MAXVALUE
1089+
CACHE 1;
1090+
1091+
1092+
--
1093+
-- Name: task_skills_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1094+
--
1095+
1096+
ALTER SEQUENCE task_skills_id_seq OWNED BY task_skills.id;
1097+
1098+
10691099
--
10701100
-- Name: tasks; Type: TABLE; Schema: public; Owner: -
10711101
--
@@ -1251,7 +1281,6 @@ CREATE TABLE users (
12511281
website character varying(255),
12521282
twitter character varying(255),
12531283
biography text,
1254-
photo character varying(255),
12551284
admin boolean DEFAULT false NOT NULL,
12561285
state character varying(255) DEFAULT 'signed_up'::character varying,
12571286
cloudinary_public_id character varying(255),
@@ -1460,6 +1489,13 @@ ALTER TABLE ONLY stripe_platform_customers ALTER COLUMN id SET DEFAULT nextval('
14601489
ALTER TABLE ONLY task_lists ALTER COLUMN id SET DEFAULT nextval('task_lists_id_seq'::regclass);
14611490

14621491

1492+
--
1493+
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
1494+
--
1495+
1496+
ALTER TABLE ONLY task_skills ALTER COLUMN id SET DEFAULT nextval('task_skills_id_seq'::regclass);
1497+
1498+
14631499
--
14641500
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
14651501
--
@@ -1678,6 +1714,14 @@ ALTER TABLE ONLY task_lists
16781714
ADD CONSTRAINT task_lists_pkey PRIMARY KEY (id);
16791715

16801716

1717+
--
1718+
-- Name: task_skills_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1719+
--
1720+
1721+
ALTER TABLE ONLY task_skills
1722+
ADD CONSTRAINT task_skills_pkey PRIMARY KEY (id);
1723+
1724+
16811725
--
16821726
-- Name: user_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
16831727
--
@@ -2019,6 +2063,13 @@ CREATE UNIQUE INDEX stripe_platform_customers_user_id_index ON stripe_platform_c
20192063
CREATE INDEX task_lists_project_id_index ON task_lists USING btree (project_id);
20202064

20212065

2066+
--
2067+
-- Name: task_skills_task_id_skill_id_index; Type: INDEX; Schema: public; Owner: -
2068+
--
2069+
2070+
CREATE UNIQUE INDEX task_skills_task_id_skill_id_index ON task_skills USING btree (task_id, skill_id);
2071+
2072+
20222073
--
20232074
-- Name: tasks_number_project_id_index; Type: INDEX; Schema: public; Owner: -
20242075
--
@@ -2361,6 +2412,22 @@ ALTER TABLE ONLY task_lists
23612412
ADD CONSTRAINT task_lists_project_id_fkey FOREIGN KEY (project_id) REFERENCES projects(id);
23622413

23632414

2415+
--
2416+
-- Name: task_skills_skill_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2417+
--
2418+
2419+
ALTER TABLE ONLY task_skills
2420+
ADD CONSTRAINT task_skills_skill_id_fkey FOREIGN KEY (skill_id) REFERENCES skills(id);
2421+
2422+
2423+
--
2424+
-- Name: task_skills_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
2425+
--
2426+
2427+
ALTER TABLE ONLY task_skills
2428+
ADD CONSTRAINT task_skills_task_id_fkey FOREIGN KEY (task_id) REFERENCES tasks(id);
2429+
2430+
23642431
--
23652432
-- Name: tasks_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
23662433
--
@@ -2453,5 +2520,5 @@ ALTER TABLE ONLY user_tasks
24532520
-- PostgreSQL database dump complete
24542521
--
24552522

2456-
INSERT INTO "schema_migrations" (version) VALUES (20160723215749), (20160804000000), (20160804001111), (20160805132301), (20160805203929), (20160808143454), (20160809214736), (20160810124357), (20160815125009), (20160815143002), (20160816020347), (20160816034021), (20160817220118), (20160818000944), (20160818132546), (20160820113856), (20160820164905), (20160822002438), (20160822004056), (20160822011624), (20160822020401), (20160822044612), (20160830081224), (20160830224802), (20160911233738), (20160912002705), (20160912145957), (20160918003206), (20160928232404), (20161003185918), (20161019090945), (20161019110737), (20161020144622), (20161021131026), (20161031001615), (20161121005339), (20161121014050), (20161121043941), (20161121045709), (20161122015942), (20161123081114), (20161123150943), (20161124085742), (20161125200620), (20161126045705), (20161127054559), (20161205024856), (20161207112519), (20161209192504), (20161212005641), (20161214005935), (20161215052051), (20161216051447), (20161218005913), (20161219160401), (20161219163909), (20161220141753), (20161221085759), (20161226213600), (20161231063614), (20170102130055), (20170102181053), (20170104113708), (20170104212623), (20170104235423), (20170106013143), (20170115035159), (20170115230549), (20170121014100), (20170201014901), (20170201025454), (20170201035458);
2523+
INSERT INTO "schema_migrations" (version) VALUES (20160723215749), (20160804000000), (20160804001111), (20160805132301), (20160805203929), (20160808143454), (20160809214736), (20160810124357), (20160815125009), (20160815143002), (20160816020347), (20160816034021), (20160817220118), (20160818000944), (20160818132546), (20160820113856), (20160820164905), (20160822002438), (20160822004056), (20160822011624), (20160822020401), (20160822044612), (20160830081224), (20160830224802), (20160911233738), (20160912002705), (20160912145957), (20160918003206), (20160928232404), (20161003185918), (20161019090945), (20161019110737), (20161020144622), (20161021131026), (20161031001615), (20161121005339), (20161121014050), (20161121043941), (20161121045709), (20161122015942), (20161123081114), (20161123150943), (20161124085742), (20161125200620), (20161126045705), (20161127054559), (20161205024856), (20161207112519), (20161209192504), (20161212005641), (20161214005935), (20161215052051), (20161216051447), (20161218005913), (20161219160401), (20161219163909), (20161220141753), (20161221085759), (20161226213600), (20161231063614), (20170102130055), (20170102181053), (20170104113708), (20170104212623), (20170104235423), (20170106013143), (20170115035159), (20170115230549), (20170121014100), (20170131234029), (20170201014901), (20170201025454), (20170201035458), (20170201183258);
24572524

test/views/organization_view_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule CodeCorps.OrganizationViewTest do
99
slugged_route = insert(:slugged_route, organization: organization)
1010
stripe_connect_account = insert(:stripe_connect_account, organization: organization)
1111

12-
host = Application.get_env(:arc, :asset_host)
12+
host = Application.get_env(:code_corps, :asset_host)
1313

1414
rendered_json = render(CodeCorps.OrganizationView, "show.json-api", data: organization)
1515

test/views/project_view_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule CodeCorps.ProjectViewTest do
1212
task_list = insert(:task_list, project: project)
1313
task = insert(:task, project: project, task_list: task_list)
1414

15-
host = Application.get_env(:arc, :asset_host)
15+
host = Application.get_env(:code_corps, :asset_host)
1616

1717
rendered_json = render(CodeCorps.ProjectView, "show.json-api", data: project)
1818

test/views/user_view_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defmodule CodeCorps.UserViewTest do
1515
user_role = insert(:user_role, user: user)
1616
user_skill = insert(:user_skill, user: user)
1717

18-
host = Application.get_env(:arc, :asset_host)
18+
host = Application.get_env(:code_corps, :asset_host)
1919

2020
rendered_json = render(CodeCorps.UserView, "show.json-api", data: user)
2121

web/models/organization.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ defmodule CodeCorps.Organization do
33
Represents an organization on Code Corps, e.g. "Code Corps" itself.
44
"""
55

6-
use Arc.Ecto.Schema
76
use CodeCorps.Web, :model
87
import CodeCorps.Helpers.RandomIconColor
98
import CodeCorps.Helpers.Slug
@@ -14,7 +13,6 @@ defmodule CodeCorps.Organization do
1413
field :cloudinary_public_id
1514
field :default_color
1615
field :description, :string
17-
field :icon, CodeCorps.OrganizationIcon.Type
1816
field :name, :string
1917
field :slug, :string
2018
field :approved, :boolean

0 commit comments

Comments
 (0)