LINUX.ORG.RU
Ответ на: комментарий от stevejobs

Таки да

pry(main)> ActiveRecord::Base.connection.execute("create table inventors (id bigint not null auto_increment, name varchar(255) not null, inventions varchar(255), primary key (id))")
   (272.2ms)  create table inventors (id bigint not null auto_increment, name varchar(255) not null, inventions varchar(255), primary key (id))
=> nil
pry(main)> class Inventor < ActiveRecord::Base; end
=> nil
pry(main)> Inventor.create(:name => 'Steve Jobs', :inventions => 'Desktop computer, notebook, mp3 player, smartphone, tablet computer')
   (0.2ms)  BEGIN
  SQL (30.4ms)  INSERT INTO `inventors` (`name`, `inventions`) VALUES ('Steve Jobs', 'Desktop computer, notebook, mp3 player, smartphone, tablet computer')
   (0.6ms)  COMMIT
=> #<Inventor id: 1, name: "Steve Jobs">
pry(main)> Inventor.connection.execute("update inventors set id = 9223372036854775807 where id = 1")
   (0.7ms)  update inventors set id = 9223372036854775807 where id = 1
=> nil
pry(main)> Inventor.first
  Inventor Load (0.7ms)  SELECT `inventors`.* FROM `inventors` LIMIT 1
=> #<Inventor id: 9223372036854775807, name: "Steve Jobs", inventions: "Desktop computer, notebook, mp3 player, smartphone, tablet computer">
pry(main)> Inventor.find_by_name("Steve Jobs").id
  Inventor Load (0.7ms)  SELECT `inventors`.* FROM `inventors` WHERE `inventors`.`name` = 'Steve Jobs' LIMIT 1
=> 9223372036854775807

АПВС?

Apple-ch ★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.