Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
6f929ef8
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6f929ef8
编写于
8月 15, 2010
作者:
X
Xavier Noria
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'rails/master'
上级
0d5a0607
3ba61ecb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
16 deletion
+20
-16
actionpack/test/controller/resources_test.rb
actionpack/test/controller/resources_test.rb
+1
-1
activerecord/test/cases/attribute_methods_test.rb
activerecord/test/cases/attribute_methods_test.rb
+2
-1
activerecord/test/cases/base_test.rb
activerecord/test/cases/base_test.rb
+14
-13
activerecord/test/models/boolean.rb
activerecord/test/models/boolean.rb
+2
-0
activerecord/test/schema/schema.rb
activerecord/test/schema/schema.rb
+1
-1
未找到文件。
actionpack/test/controller/resources_test.rb
浏览文件 @
6f929ef8
require
'active_support/core_ext/object/try'
require
'abstract_unit'
require
'active_support/core_ext/object/try'
class
ResourcesController
<
ActionController
::
Base
def
index
()
render
:nothing
=>
true
end
...
...
activerecord/test/cases/attribute_methods_test.rb
浏览文件 @
6f929ef8
...
...
@@ -2,6 +2,7 @@
require
'models/minimalistic'
require
'models/developer'
require
'models/auto_id'
require
'models/boolean'
require
'models/computer'
require
'models/topic'
require
'models/company'
...
...
@@ -101,7 +102,7 @@ def test_read_attributes_before_type_cast
if
current_adapter?
(
:MysqlAdapter
)
def
test_read_attributes_before_type_cast_on_boolean
bool
=
Boolean
test
.
create
({
"value"
=>
false
})
bool
=
Boolean
.
create
({
"value"
=>
false
})
assert_equal
"0"
,
bool
.
reload
.
attributes_before_type_cast
[
"value"
]
end
end
...
...
activerecord/test/cases/base_test.rb
浏览文件 @
6f929ef8
...
...
@@ -10,6 +10,7 @@
require
'models/project'
require
'models/default'
require
'models/auto_id'
require
'models/boolean'
require
'models/column_name'
require
'models/subscriber'
require
'models/keyboard'
...
...
@@ -42,7 +43,7 @@ class ReadonlyTitlePost < Post
attr_readonly
:title
end
class
Boolean
test
<
ActiveRecord
::
Base
;
end
class
Boolean
<
ActiveRecord
::
Base
;
end
class
BasicsTest
<
ActiveRecord
::
TestCase
fixtures
:topics
,
:companies
,
:developers
,
:projects
,
:computers
,
:accounts
,
:minimalistics
,
'warehouse-things'
,
:authors
,
:categorizations
,
:categories
,
:posts
...
...
@@ -596,34 +597,34 @@ def test_attributes_on_dummy_time
end
def
test_boolean
b_nil
=
Boolean
test
.
create
({
"value"
=>
nil
})
b_nil
=
Boolean
.
create
({
"value"
=>
nil
})
nil_id
=
b_nil
.
id
b_false
=
Boolean
test
.
create
({
"value"
=>
false
})
b_false
=
Boolean
.
create
({
"value"
=>
false
})
false_id
=
b_false
.
id
b_true
=
Boolean
test
.
create
({
"value"
=>
true
})
b_true
=
Boolean
.
create
({
"value"
=>
true
})
true_id
=
b_true
.
id
b_nil
=
Boolean
test
.
find
(
nil_id
)
b_nil
=
Boolean
.
find
(
nil_id
)
assert_nil
b_nil
.
value
b_false
=
Boolean
test
.
find
(
false_id
)
b_false
=
Boolean
.
find
(
false_id
)
assert
!
b_false
.
value?
b_true
=
Boolean
test
.
find
(
true_id
)
b_true
=
Boolean
.
find
(
true_id
)
assert
b_true
.
value?
end
def
test_boolean_cast_from_string
b_blank
=
Boolean
test
.
create
({
"value"
=>
""
})
b_blank
=
Boolean
.
create
({
"value"
=>
""
})
blank_id
=
b_blank
.
id
b_false
=
Boolean
test
.
create
({
"value"
=>
"0"
})
b_false
=
Boolean
.
create
({
"value"
=>
"0"
})
false_id
=
b_false
.
id
b_true
=
Boolean
test
.
create
({
"value"
=>
"1"
})
b_true
=
Boolean
.
create
({
"value"
=>
"1"
})
true_id
=
b_true
.
id
b_blank
=
Boolean
test
.
find
(
blank_id
)
b_blank
=
Boolean
.
find
(
blank_id
)
assert_nil
b_blank
.
value
b_false
=
Boolean
test
.
find
(
false_id
)
b_false
=
Boolean
.
find
(
false_id
)
assert
!
b_false
.
value?
b_true
=
Boolean
test
.
find
(
true_id
)
b_true
=
Boolean
.
find
(
true_id
)
assert
b_true
.
value?
end
...
...
activerecord/test/models/boolean.rb
0 → 100644
浏览文件 @
6f929ef8
class
Boolean
<
ActiveRecord
::
Base
end
activerecord/test/schema/schema.rb
浏览文件 @
6f929ef8
...
...
@@ -74,7 +74,7 @@ def create_table(*args, &block)
t
.
column
:name
,
:string
end
create_table
:boolean
test
s
,
:force
=>
true
do
|
t
|
create_table
:booleans
,
:force
=>
true
do
|
t
|
t
.
boolean
:value
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录