Skip to content

Commit 965b0a6

Browse files
authored
Merge pull request #814 from portagenetwork/aaron/issues/813
Use "id" Instead of "name" For `default_funder` Org
2 parents 3cf8b9c + 69c150f commit 965b0a6

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
- Use "id" instead of "name" for `default_funder` Org [#814](https://github.com/portagenetwork/roadmap/pull/814)
8+
59
- Bump jwt from 2.7.1 to 2.8.2 [#803](https://github.com/portagenetwork/roadmap/pull/803)
610

711
- Bump cssbundling-rails from 1.3.3 to 1.4.0 [#796](https://github.com/portagenetwork/roadmap/pull/796)

app/controllers/template_options_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def index
1717
authorize Template.new, :template_options?
1818

1919
org = org_from_params(params_in: { org_id: org_hash.to_json }) if org_hash.present?
20-
funder = Org.find_by(name: Rails.application.config.default_funder_name)
20+
funder = Org.find(Rails.application.config.default_funder_id)
2121

2222
@templates = []
2323

config/application.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,6 @@ class Application < Rails::Application
108108
# removed the option for selecting a funder. A funder is needed to show the
109109
# customized templates. For this reason we are specifying in the
110110
# documentation the funder that
111-
config.default_funder_name = Rails.application.secrets.default_funder_name
111+
config.default_funder_id = Rails.application.secrets.default_funder_id.to_i
112112
end
113113
end

config/secrets.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test:
3030
translation_io_api_key: <%= ENV['TRANSLATION_IO_API_KEY'] %>
3131
wicked_pdf_path: <%= ENV['WICKED_PDF_PATH'] %>
3232
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>
33-
default_funder_name: <%= ENV['DEFAULT_FUNDER_NAME'] %>
33+
default_funder_id: <%= ENV['DEFAULT_FUNDER_ID'] %>
3434
super_admin_password: <%= ENV["SUPER_ADMIN_PASSWORD"] %>
3535
test_password: <%= ENV["TEST_PASSWORD"] %>
3636
user_password: <%= ENV["USER_PASSWORD"] %>
@@ -61,7 +61,7 @@ development:
6161
translation_io_api_key: <%= ENV['TRANSLATION_IO_API_KEY'] %>
6262
wicked_pdf_path: <%= ENV['WICKED_PDF_PATH'] %>
6363
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>
64-
default_funder_name: <%= ENV['DEFAULT_FUNDER_NAME'] %>
64+
default_funder_id: <%= ENV['DEFAULT_FUNDER_ID'] %>
6565
super_admin_password: <%= ENV["SUPER_ADMIN_PASSWORD"] %>
6666
test_password: <%= ENV["TEST_PASSWORD"] %>
6767
user_password: <%= ENV["USER_PASSWORD"] %>
@@ -101,7 +101,7 @@ staging:
101101
translation_io_api_key: <%= ENV['TRANSLATION_IO_API_KEY'] %>
102102
wicked_pdf_path: <%= ENV['WICKED_PDF_PATH'] %>
103103
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>
104-
default_funder_name: <%= ENV['DEFAULT_FUNDER_NAME'] %>
104+
default_funder_id: <%= ENV['DEFAULT_FUNDER_ID'] %>
105105
super_admin_password: <%= ENV["SUPER_ADMIN_PASSWORD"] %>
106106
test_password: <%= ENV["TEST_PASSWORD"] %>
107107
user_password: <%= ENV["USER_PASSWORD"] %>
@@ -141,7 +141,7 @@ uat:
141141
translation_io_api_key: <%= ENV['TRANSLATION_IO_API_KEY'] %>
142142
wicked_pdf_path: <%= ENV['WICKED_PDF_PATH'] %>
143143
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>
144-
default_funder_name: <%= ENV['DEFAULT_FUNDER_NAME'] %>
144+
default_funder_id: <%= ENV['DEFAULT_FUNDER_ID'] %>
145145
super_admin_password: <%= ENV["SUPER_ADMIN_PASSWORD"] %>
146146
test_password: <%= ENV["TEST_PASSWORD"] %>
147147
user_password: <%= ENV["USER_PASSWORD"] %>
@@ -181,7 +181,7 @@ sandbox:
181181
translation_io_api_key: <%= ENV['TRANSLATION_IO_API_KEY'] %>
182182
wicked_pdf_path: <%= ENV['WICKED_PDF_PATH'] %>
183183
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>
184-
default_funder_name: <%= ENV['DEFAULT_FUNDER_NAME'] %>
184+
default_funder_id: <%= ENV['DEFAULT_FUNDER_ID'] %>
185185
super_admin_password: <%= ENV["SUPER_ADMIN_PASSWORD"] %>
186186
test_password: <%= ENV["TEST_PASSWORD"] %>
187187
user_password: <%= ENV["USER_PASSWORD"] %>
@@ -221,7 +221,7 @@ production:
221221
translation_io_api_key: <%= ENV['TRANSLATION_IO_API_KEY'] %>
222222
wicked_pdf_path: <%= ENV['WICKED_PDF_PATH'] %>
223223
wicked_pdf_proxy: <%= ENV['WICKED_PDF_PROXY'] %>
224-
default_funder_name: <%= ENV['DEFAULT_FUNDER_NAME'] %>
224+
default_funder_id: <%= ENV['DEFAULT_FUNDER_ID'] %>
225225
super_admin_password: <%= ENV["SUPER_ADMIN_PASSWORD"] %>
226226
test_password: <%= ENV["TEST_PASSWORD"] %>
227227
user_password: <%= ENV["USER_PASSWORD"] %>

0 commit comments

Comments
 (0)