Skip to content

Commit

Permalink
Merge pull request #37 from takahashim/fix-028-b
Browse files Browse the repository at this point in the history
merge main
  • Loading branch information
ayuki-joto authored Aug 27, 2024
2 parents 8fe26b9 + 0487341 commit 50afa4a
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## [1.2.4](https://github.com/codeforjapan/decidim-cfj/compare/v1.2.3...v1.2.4) (2024-08-06)


### Bug Fixes

* local docker postgres ([287786f](https://github.com/codeforjapan/decidim-cfj/commit/287786f30ab050c9fd32ade9d4e31f8795e4bd16))
* use `decidim_sanitize_admin` instead of `decidim_escape_translated` ([863bcb7](https://github.com/codeforjapan/decidim-cfj/commit/863bcb756cf9cc4ad9139b84662df8efeb69b28e))
* Use Redis with docker compose ([a97e0ed](https://github.com/codeforjapan/decidim-cfj/commit/a97e0ed328246933bb8e98f863d350b1bc7e1959))

## [1.2.3](https://github.com/codeforjapan/decidim-cfj/compare/v1.2.2...v1.2.3) (2024-07-30)


Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.17.1-bullseye-slim as node
FROM node:18.17.1-bullseye-slim AS node

FROM ruby:3.1.1-slim-bullseye

Expand Down
30 changes: 30 additions & 0 deletions app/views/decidim/accountability/results/_timeline.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="small-12 columns">
<div class="section">
<h4 class="section-heading"><%= t(".title") %></h4>
<ol class="timeline">
<% result.timeline_entries.each_with_index do |timeline_entry, i| %>
<li class="timeline__item ">
<div class="timeline__phase">
<span class="timeline__phase__number"><%= i + 1 %></span>
</div>
<div class="timeline__info">
<div class="timeline__description">
<span class="timeline__date text-small">
<%= l timeline_entry.entry_date, format: :decidim_short %>
</span>
<h4 class="timeline__title">
<%= translated_attribute timeline_entry.title %>
</h4>

<% if translated_attribute(timeline_entry.description).present? %>
<div class="timeline__description__description">
<%= decidim_sanitize_admin translated_attribute(timeline_entry.description) %>
</div>
<% end %>
</div>
</div>
</li>
<% end %>
</ol>
</div>
</div>
14 changes: 13 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
x-custom:
app:
- &rails_env "development"
- &redis_cache_url "${REDIS_CACHE_URL:-redis://redis:6379/0}"
postgres:
- &postgres_user "${DATABASE_USERNAME:-postgres}"
- &postgres_password "${DATABASE_PASSWORD:-password}"
Expand Down Expand Up @@ -29,9 +30,9 @@ services:
volumes:
- .:/app
- node_modules:/app/node_modules
- rails-tmp:/app/tmp
# exclude volumes
- /app/vendor
- /app/tmp
- /app/log
- /app/.git
environment:
Expand All @@ -40,8 +41,11 @@ services:
DATABASE_USERNAME: *postgres_user
DATABASE_PASSWORD: *postgres_password
RAILS_ENV: *rails_env
REDIS_URL: *redis_cache_url
REDIS_CACHE_URL: *redis_cache_url
links:
- pg
- redis
pg:
image: "ghcr.io/codeforjapan/postgresql_bigm:12-latest"
volumes:
Expand All @@ -51,7 +55,15 @@ services:
POSTGRES_PASSWORD: *postgres_password
ports:
- 5433:5432
redis:
image: redis
ports:
- 6379:6379
volumes:
- redis-data:/data

volumes:
node_modules: {}
pg-data: {}
redis-data: {}
rails-tmp: {}
16 changes: 16 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,19 @@ http://localhost:3000 にアクセス
* サービス画面 (http://localhost:3000/users/sign_in?locale=ja)
* [email protected] (組織管理者)
* [email protected] (通常ユーザ)

## 5. キャッシュとRedisについて

Railsのキャッシュはproduction環境ではRedis Cache Store(`ActiveSupport::Cache::RedisCacheStore`)を使うようになっています。

Redisの設定は環境変数 `REDIS_CACHE_URL` を使用しています。

development環境でのRailsの標準機能として、キャッシュのオン・オフをトグルで制御できます。オン・オフを切り替えたい場合、以下のコマンドを実行してください。

```console
# dockerを使っている場合
docker compose run app rails dev:cache

# localで動かしている場合
bin/rails dev:cache
```

0 comments on commit 50afa4a

Please sign in to comment.