Hi everyone, I have these classes:
class User < Sequel::Model one_to_one :password one_to_many :old_password end class Password < Sequel::Model(:user_password_hashes) many_to_one :user end that correspond to the following migrations: create_table(:users) do primary_key :id, :type=>:Bignum String :name, null: false String :first_name, null: false citext :email, :null=>false constraint :valid_email, :email=>/^[^,;@ \r\n]+@[^,@; \r\n]+\.[^,@; \r\n]+$/ index :email, :unique=>true Boolean :superuser, null: false, :default=>false Boolean :administrator, null: false, :default=>false Boolean :user, null: false, :default=>true DateTime :created_at, :null=>false, :default=>Sequel::CURRENT_TIMESTAMP end create_table(:user_password_hashes) do foreign_key :id, :users, :primary_key=>true, :type=>:Bignum, :unique=>true String :password_hash, :null=>false end Creating a user doesn't raise any problems and is correctly added to the database: user = User.create( name: @request_payload['nom'], first_name: @request_payload['prenom'], email: @request_payload['mail'], superuser: true, administrator: false, user: false ) But adding a password raises an error. I do this: # @request_payload['pass'] is the password the user submits password = BCrypt::Password.create( @request_payload['pass'] ) # add_password which is the model name that corresponds to the # table I set with this method: Sequel::Model(:user_password_hashes) user.add_password(password_hash: password) The error is: *NoMethodError - undefined method `add_password' for #<User @values={:id=>14, :name=>"foo", :first_name=>"frodo", :email=>"tf...@moi.fr", :superuser=>true, :administrator=>false, :user=>false, :created_at=>2022-05-07 08:26:28.928112 +0200}> user.add_password(password_hash: password) ^^^^^^^^^^^^^Did you mean? add_old_password:* Any help is much appreciated. -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to sequel-talk+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/611118eb-ddd6-44fa-bd57-2be74432e6c5n%40googlegroups.com.