Homeland 有一段代码 不太理解 求大神指教

sdfsd · October 08, 2020 · 124 hits

更新用户个人信息 来源 homeland

def user_params

attrs = User::ACCESSABLE_ATTRS.dup

if Setting.allow_change_login?

attrs << :login

end

if !current_user.email_locked?

attrs << :email

end

params.require(:user).permit(*attrs)

end

第二行不是已经 浅拷贝了么 也就是说 attrs 是独立内存空间了 是不是

那倒数第二行的 *attrs 意义是什么

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.