Module: DmCore::PermittedParams
- Included in:
- Admin::AccountsController, Admin::CommentsController, Admin::SystemController, ApplicationController, Concerns::ConfirmationsController, Concerns::ProfileController, Concerns::RegistrationsController
- Defined in:
- app/models/dm_core/permitted_params.rb
Instance Method Summary collapse
-
#account_params ⇒ Object
——————————————————————————.
-
#comment_params ⇒ Object
——————————————————————————.
-
#devise_sign_up_params(the_params) ⇒ Object
——————————————————————————.
-
#user_params ⇒ Object
——————————————————————————.
-
#user_profile_direct_params(the_params) ⇒ Object
used during a userless event registration ——————————————————————————.
-
#user_profile_params ⇒ Object
——————————————————————————.
Instance Method Details
#account_params ⇒ Object
5 6 7 |
# File 'app/models/dm_core/permitted_params.rb', line 5 def account_params params.require(:account).permit! if current_user.try(:is_admin?) end |
#comment_params ⇒ Object
41 42 43 |
# File 'app/models/dm_core/permitted_params.rb', line 41 def comment_params params.require(:comment).permit(:title, :body, :user_id) end |
#devise_sign_up_params(the_params) ⇒ Object
46 47 48 49 50 |
# File 'app/models/dm_core/permitted_params.rb', line 46 def devise_sign_up_params(the_params) the_params.permit(:email, :password, :password_confirmation, :newsletter, :plan, :affiliate, user_profile_attributes: [:public_name, :first_name, :last_name, :public_avatar, :address, :address2, :city, :state, :zipcode, :country_id]) end |
#user_params ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/models/dm_core/permitted_params.rb', line 10 def user_params if can? :manage, :all params.require(:user).permit! else params.require(:user).permit(:email, :password, :password_confirmation, :current_password) end end |
#user_profile_direct_params(the_params) ⇒ Object
used during a userless event registration
30 31 32 33 34 35 36 37 38 |
# File 'app/models/dm_core/permitted_params.rb', line 30 def user_profile_direct_params(the_params) if can? :manage, :all the_params.permit! else the_params.permit( :public_name, :first_name, :last_name, :public_avatar, :address, :address2, :city, :state, :zipcode, :country_id, :userless_registration, :address_required, :email) end end |
#user_profile_params ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/models/dm_core/permitted_params.rb', line 19 def user_profile_params if can? :manage, :all params.require(:user_profile).permit! else params.require(:user_profile).permit( :public_name, :first_name, :last_name, :public_avatar, :address, :address2, :city, :state, :zipcode, :country_id) end end |