mercredi 1 avril 2015

rails duplication code user_attributes


Vote count:

0




I have master admin who can create two different admin [property, content_contributor]. so in master admin's require params i have this



class MasterAdmins::ContentContributorsController < MasterAdmins::MainController
....
params.require(:content_contributor).permit(:user_id, user_attributes: [:id, :activation_token, :email, :encrypted_password, :authentication_token, :sign_in_count]


and in master admins property i have this



class MasterAdmins::PropertyAdminsController < MasterAdmins::MainController
.....
params.require(:property_admin).permit(user_attributes: [:id, :activation_token, :email, :encrypted_password, :authentication_token, :sign_in_count]


I am getting duplicate found in code climate, how can i avoid the user attribute duplication?



asked 1 min ago







rails duplication code user_attributes

Aucun commentaire:

Enregistrer un commentaire