02 2015 档案

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