app/controllers/concerns/account/memberships/controller_base.rb in bullet_train-1.0.11 vs app/controllers/concerns/account/memberships/controller_base.rb in bullet_train-1.0.12

- old
+ new

@@ -1,10 +1,12 @@ module Account::Memberships::ControllerBase extend ActiveSupport::Concern included do - account_load_and_authorize_resource :membership, :team, member_actions: [:demote, :promote, :reinvite], collection_actions: [:search] + account_load_and_authorize_resource :membership, :team, + member_actions: [:demote, :promote, :reinvite].merge(defined?(MEMBER_ACTIONS) ? MEMBER_ACTIONS : []), + collection_actions: [:search].merge(defined?(COLLECTION_ACTIONS) ? COLLECTION_ACTIONS : []) end def index unless @memberships.count > 0 redirect_to account_team_invitations_path(@team), notice: I18n.t("memberships.notifications.no_members") @@ -102,12 +104,12 @@ # we use strong params first. strong_params = params.require(:membership).permit( :user_first_name, :user_last_name, :user_profile_photo_id, - # 🚅 super scaffolding will insert new fields above this line. - # 🚅 super scaffolding will insert new arrays above this line. + *permitted_fields, + *permitted_arrays, ) # after that, we have to be more careful how we update the roles. # we can't let users remove roles from a membership that they don't have permission # to remove, but we want to allow them to add or remove other roles they do have @@ -129,8 +131,8 @@ end # 🚅 super scaffolding will insert processing for new fields above this line. - strong_params + process_params(strong_params) end end