比较两个字符串表达式"batman" != "batman"
时无法创建对象,但是当"batman" != "robin"
它成功创建对象时,发生了什么?
class WebsiteLink < ActiveRecord::Base
attr_accessible :external
before_save :external?
private
def external?
if "batman" != "batman"
self.external = true
else
self.external = false
end
end
end