Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
33721a71
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,发现更多精彩内容 >>
未验证
提交
33721a71
编写于
1月 09, 2018
作者:
K
Kasper Timm Hansen
提交者:
GitHub
1月 09, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #31534 from claudiob/kaspth-approach
Don't include Active Storage migrations in new apps
上级
baa88b8d
e32eda6a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
16 deletion
+37
-16
actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
...npack/lib/action_dispatch/middleware/exception_wrapper.rb
+1
-0
actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb
...h/middleware/templates/rescues/invalid_statement.html.erb
+21
-0
actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb
...h/middleware/templates/rescues/invalid_statement.text.erb
+13
-0
guides/source/active_storage_overview.md
guides/source/active_storage_overview.md
+0
-3
railties/lib/rails/generators/app_base.rb
railties/lib/rails/generators/app_base.rb
+0
-10
railties/lib/rails/generators/rails/app/app_generator.rb
railties/lib/rails/generators/rails/app/app_generator.rb
+0
-1
railties/test/generators/app_generator_test.rb
railties/test/generators/app_generator_test.rb
+2
-2
未找到文件。
actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
浏览文件 @
33721a71
...
...
@@ -25,6 +25,7 @@ class ExceptionWrapper
"ActionView::MissingTemplate"
=>
"missing_template"
,
"ActionController::RoutingError"
=>
"routing_error"
,
"AbstractController::ActionNotFound"
=>
"unknown_action"
,
"ActiveRecord::StatementInvalid"
=>
"invalid_statement"
,
"ActionView::Template::Error"
=>
"template_error"
)
...
...
actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb
0 → 100644
浏览文件 @
33721a71
<header>
<h1>
<%=
@exception
.
class
.
to_s
%>
<%
if
@request
.
parameters
[
'controller'
]
%>
in
<%=
@request
.
parameters
[
'controller'
].
camelize
%>
Controller
<%
if
@request
.
parameters
[
'action'
]
%>
#
<%=
@request
.
parameters
[
'action'
]
%><%
end
%>
<%
end
%>
</h1>
</header>
<div
id=
"container"
>
<h2>
<%=
h
@exception
.
message
%>
<%
if
@exception
.
message
.
match?
%r{
#{
ActiveStorage
::
Blob
.
table_name
}
|
#{
ActiveStorage
::
Attachment
.
table_name
}
}
%>
<br
/>
To resolve this issue run: bin/rails active_storage:install
<%
end
%>
</h2>
<%=
render
template:
"rescues/_source"
%>
<%=
render
template:
"rescues/_trace"
%>
<%=
render
template:
"rescues/_request_and_response"
%>
</div>
actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb
0 → 100644
浏览文件 @
33721a71
<%=
@exception
.
class
.
to_s
%><%
if
@request
.
parameters
[
'controller'
]
%>
in
<%=
@request
.
parameters
[
'controller'
].
camelize
%>
Controller
<%
if
@request
.
parameters
[
'action'
]
%>
#
<%=
@request
.
parameters
[
'action'
]
%><%
end
%>
<%
end
%>
<%=
@exception
.
message
%>
<%
if
@exception
.
message
.
match?
%r{
#{
ActiveStorage
::
Blob
.
table_name
}
|
#{
ActiveStorage
::
Attachment
.
table_name
}
}
%>
To resolve this issue run: bin/rails active_storage:install
<%
end
%>
<%=
render
template:
"rescues/_source"
%>
<%=
render
template:
"rescues/_trace"
%>
<%=
render
template:
"rescues/_request_and_response"
%>
guides/source/active_storage_overview.md
浏览文件 @
33721a71
...
...
@@ -41,9 +41,6 @@ application to Rails 5.2, run `rails active_storage:install` to generate a
migration that creates these tables. Use
`rails db:migrate`
to run the
migration.
You need not run
`rails active_storage:install`
in a new Rails 5.2 application:
the migration is generated automatically.
Declare Active Storage services in
`config/storage.yml`
. For each service your
application uses, provide a name and the requisite configuration. The example
below declares three services named
`local`
,
`test`
, and
`amazon`
:
...
...
railties/lib/rails/generators/app_base.rb
浏览文件 @
33721a71
...
...
@@ -463,16 +463,6 @@ def generate_spring_binstubs
end
end
def
run_active_storage
unless
skip_active_storage?
if
bundle_install?
rails_command
"active_storage:install"
,
capture:
options
[
:quiet
]
else
log
(
"Active Storage installation was skipped. Please run `bin/rails active_storage:install` to install Active Storage files."
)
end
end
end
def
empty_directory_with_keep_file
(
destination
,
config
=
{})
empty_directory
(
destination
,
config
)
keep_file
(
destination
)
...
...
railties/lib/rails/generators/rails/app/app_generator.rb
浏览文件 @
33721a71
...
...
@@ -463,7 +463,6 @@ def finish_template
public_task
:apply_rails_template
,
:run_bundle
public_task
:run_webpack
,
:generate_spring_binstubs
public_task
:run_active_storage
def
run_after_bundle_callbacks
@after_bundle_callbacks
.
each
(
&
:call
)
...
...
railties/test/generators/app_generator_test.rb
浏览文件 @
33721a71
...
...
@@ -900,7 +900,7 @@ def test_after_bundle_callback
template
end
sequence
=
[
"git init"
,
"install"
,
"exec spring binstub --all"
,
"
active_storage:install"
,
"
echo ran after_bundle"
]
sequence
=
[
"git init"
,
"install"
,
"exec spring binstub --all"
,
"echo ran after_bundle"
]
@sequence_step
||=
0
ensure_bundler_first
=
->
command
,
options
=
nil
do
assert_equal
sequence
[
@sequence_step
],
command
,
"commands should be called in sequence
#{
sequence
}
"
...
...
@@ -917,7 +917,7 @@ def test_after_bundle_callback
end
end
assert_equal
5
,
@sequence_step
assert_equal
4
,
@sequence_step
end
def
test_gitignore
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录