Skip to content

Instantly share code, notes, and snippets.

@takahashim
Last active January 31, 2021 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahashim/b412367ec7718c0e0dcf72a9058b9974 to your computer and use it in GitHub Desktop.
Save takahashim/b412367ec7718c0e0dcf72a9058b9974 to your computer and use it in GitHub Desktop.

メモ。

codeforjapan/decidim-cfj#150

「設定画面で表示・非表示を選べるようにしたい」について、 decidim_organizationsテーブルのavailable_authorizationsカラムにuser_extensionが入っているときのみ登録するという仕様が良さそう。

decidim_organizationsテーブルのavailable_authorizationsカラムはcharacter varying[]型。文字列の配列なのか…。

ユーザー属性情報のlocaleがなかったので追加。

organizationによってuser registrationのroutingが変更できるならそれで対応する方法もあるかも。

とりあえずは同じcontrollerを使うことにして、その中でcurrent_organizationを見て分岐するようにしてみる。

config/routes.rb でも条件付き分岐ができるかも。

devise_scope :user do
  get "/users/sign_up", to: "deidim/devise/user_extension/registrations#new", as: new_user_registration
  post "/users", to: "deidim/devise/user_extension/registrations#create"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment