Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
500ca98f
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,发现更多精彩内容 >>
提交
500ca98f
编写于
12月 20, 2011
作者:
V
Vijay Dev
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:lifo/docrails
上级
4fa615a8
e52786c3
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
11 addition
and
12 deletion
+11
-12
activerecord/lib/active_record/scoping/default.rb
activerecord/lib/active_record/scoping/default.rb
+8
-6
activesupport/lib/active_support/testing/assertions.rb
activesupport/lib/active_support/testing/assertions.rb
+1
-1
railties/guides/rails_guides/levenshtein.rb
railties/guides/rails_guides/levenshtein.rb
+1
-1
railties/guides/source/getting_started.textile
railties/guides/source/getting_started.textile
+0
-3
railties/guides/source/migrations.textile
railties/guides/source/migrations.textile
+1
-1
未找到文件。
activerecord/lib/active_record/scoping/default.rb
浏览文件 @
500ca98f
...
...
@@ -12,7 +12,7 @@ module Default
end
module
ClassMethods
# Returns a scope for th
is class without taking into accoun
t the default_scope.
# Returns a scope for th
e model withou
t the default_scope.
#
# class Post < ActiveRecord::Base
# def self.default_scope
...
...
@@ -23,15 +23,17 @@ module ClassMethods
# Post.all # Fires "SELECT * FROM posts WHERE published = true"
# Post.unscoped.all # Fires "SELECT * FROM posts"
#
# This method also accepts a block
meaning that a
ll queries inside the block will
# This method also accepts a block
. A
ll queries inside the block will
# not use the default_scope:
#
# Post.unscoped {
# Post.limit(10) # Fires "SELECT * FROM posts LIMIT 10"
# }
#
# It is recommended to use block form of unscoped because chaining unscoped with <tt>scope</tt>
# does not work. Assuming that <tt>published</tt> is a <tt>scope</tt> following two statements are same.
# It is recommended to use the block form of unscoped because chaining
# unscoped with <tt>scope</tt> does not work. Assuming that
# <tt>published</tt> is a <tt>scope</tt>, the following two statements
# are equal: the default_scope is applied on both.
#
# Post.unscoped.published
# Post.published
...
...
activesupport/lib/active_support/testing/assertions.rb
浏览文件 @
500ca98f
...
...
@@ -87,7 +87,7 @@ def assert_blank(object, message=nil)
# Test if an expression is not blank. Passes if object.present? is true.
#
# assert_present
{:data => 'x' }
# => true
# assert_present
({:data => 'x' })
# => true
def
assert_present
(
object
,
message
=
nil
)
message
||=
"
#{
object
.
inspect
}
is blank"
assert
object
.
present?
,
message
...
...
railties/guides/rails_guides/levenshtein.rb
浏览文件 @
500ca98f
module
RailsGuides
module
Levenshtein
# Based on the pseudocode in http://en.wikipedia.org/wiki/Levenshtein_distance
.
# Based on the pseudocode in http://en.wikipedia.org/wiki/Levenshtein_distance
def
self
.
distance
(
s1
,
s2
)
s
=
s1
.
unpack
(
'U*'
)
t
=
s2
.
unpack
(
'U*'
)
...
...
railties/guides/source/getting_started.textile
浏览文件 @
500ca98f
...
...
@@ -41,9 +41,6 @@ internet for learning Ruby, including:
* "Programming Ruby":http://www.ruby-doc.org/docs/ProgrammingRuby/
* "Why's (Poignant) Guide to Ruby":http://mislav.uniqpath.com/poignant-guide/
Also, the example code for this guide is available in the rails github:https://github.com/rails/rails repository
in rails/railties/guides/code/getting_started.
h3. What is Rails?
TIP: This section goes into the background and philosophy of the Rails framework
...
...
railties/guides/source/migrations.textile
浏览文件 @
500ca98f
...
...
@@ -814,7 +814,7 @@ replaying the entire migration history. It is much simpler and faster to just
load into the database a description of the current schema.
For example, this is how the test database is created: the current development
database is dumped (either to +db/schema.rb+ or +db/
development
.sql+) and then
database is dumped (either to +db/schema.rb+ or +db/
structure
.sql+) and then
loaded into the test database.
Schema files are also useful if you want a quick look at what attributes an
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录