Fixed boolean queries for t/f fields in PostgreSQL #995 [dave@cherryville.org]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1066 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 ce96c5b3
*SVN*
* Fixed boolean queries for t/f fields in PostgreSQL #995 [dave@cherryville.org]
* Added that model.items.delete(child) will delete the child, not just set the foreign key to nil, if the child is dependent on the model #978 [bitsweat]
* Fixed auto-stamping of dates (created_on/updated_on) for PostgreSQL #985 [dave@cherryville.org]
......
......@@ -186,7 +186,7 @@ def type_cast(value)
when :time then string_to_dummy_time(value)
when :date then string_to_date(value)
when :binary then binary_to_string(value)
when :boolean then (value == "t" or value == true ? true : false)
when :boolean then value == true or value =~ /^t(rue)?$/i or value.to_s == '1'
else value
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册