`
andrew.yulong
  • 浏览: 169788 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

rails读书笔记(不断更新中....)

阅读更多
  • 如果你不愿意遵守繁文缛节,你不想表明是模型名的复数。你可以这样、
class Sheep < ActiveRecord::Base
  set_table_name "sheep"  # no "sheeps"
  #或者你还可以这样
  self.table_name = "sheep"
end
  •  sql与ruby的对应关系
SQL TYPE Ruby Class
int,Integer Fixnum
decimal,numeric BigDecimal
interval,date Date
colb,bolb,text String
float,double Float
char,varchar,string String
datatime,time Time
boolen see text
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics