You Need to Know About Ruby on Rails
Introduction
1.
ActiveRecord
1.1.
persisted? vs new_record?
1.2.
where.not
1.3.
delete vs destroy
1.4.
validates_with
1.5.
custom validators
2.
ActionController
2.1.
get a list of all the filters
Powered by
GitBook
A
A
Serif
Sans
White
Sepia
Night
Share on Twitter
Share on Google
Share on Facebook
Share on Weibo
Share on Instapaper
You Need to Know About Ruby on Rails
where.not
Explain
rails 4.0 support
User.where.not(name: 'Joe') 等價於 User.where('name != ?', 'Joe')
not null 的實作
rails 3.0 - User.where('name IS NOT NULL')
rails 4.0 - User.where.not(name: nil)