I am using Rails 5 API with devise. I have a User model. Schema looks like this.
create_table \"users\", force: :cascade do |t|
t.string \
Devise restricts attributes like encrypted_password so that the critical information doesn't get exposed in API calls. So to override this, you need to override serializable_hash method.
def serializable_hash(options = nil)
super(options).merge(encrypted_password: encrypted_password)
end
This is not a Rails 5 specific feature but a Devise feature to protect your attributes.
Hope that helps!