02 2015 档案
摘要:首先 sudo -u postgres psql postgres进入数据库后输入命令ALTER USER mydb_user WITH SUPERUSER; (把某个用户设置为超级用户)原帖:http://www.wenda.io/questions/1606940/permission-d...
阅读全文
摘要:控制器class CourseSurveysController Module(没"",不是字符串)'Test::Unit'.constantize # => Test::Unit(没"",不是字符串)class Person PersonPerson.model_name.class ...
阅读全文
摘要:默认作用域,自动加载:default_scope { order(created_at: :desc) }model 调用 find_2时才运行scope :find_2, ->{ where('clients.id' => 2 ) }下面都需要传参,使用model.find_2(id)调用scop...
阅读全文
摘要:schema.rbActiveRecord::Schema.define(version: 20150203032005) do create_table "addresses", force: true do |t| t.integer "client_id" t.string ...
阅读全文

浙公网安备 33010602011771号