Korzystam z wersji 1.1.5.
Włączone są następujące moduły:
model User
[code=ruby]class User < ActiveRecord::Base
Include default devise modules. Others available are:
:token_authenticatable, :lockable and :timeoutable
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable #,
[…][/code]
Oprócz standardowych pól dodałem także pole name(oraz w inne migracji dodatkowe):
Migration devise_create_users
[code=ruby]class DeviseCreateUsers < ActiveRecord::Migration
def self.up
create_table(:users) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable
t.confirmable
t.string :name
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.token_authenticatable
t.timestamps
end
[…][/code]
Jeśli wywołuje metodę update_attributes na polu takim jak np email, wszystko jest OK.
[code=ruby]>>a = User.find(1)
#<User id: 1, email[…]
a.update_attributes!(:email => "blebleble@gmail.com")
true[/code]
Jeśli natomiast wywołam ją na polu name lub innym “niestandardowym”:
>>a.update_attributes!(:name => "Forfiter!")
true
Zwracana jest wartość true, natomiast pole które powinno zostać zaaktualizowane, nie ulega zmianie.
Jakieś pomysły jak to ominąć?
PS Tak tak spróbuje nowszej wersji.