Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
9e34df00
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,发现更多精彩内容 >>
未验证
提交
9e34df00
编写于
1月 16, 2019
作者:
G
George Claghorn
提交者:
GitHub
1月 16, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #33419 from bogdanvlviv/update-active_storage
`rake app:update` should update active_storage
上级
36468bd2
2bad3f46
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
31 addition
and
1 deletion
+31
-1
.rubocop.yml
.rubocop.yml
+1
-0
activerecord/lib/active_record/railties/databases.rake
activerecord/lib/active_record/railties/databases.rake
+4
-0
activestorage/db/update_migrate/20180723000244_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.rb
...y_constraint_to_active_storage_attachments_for_blob_id.rb
+7
-0
activestorage/lib/tasks/activestorage.rake
activestorage/lib/tasks/activestorage.rake
+7
-0
railties/lib/rails/generators/rails/app/app_generator.rb
railties/lib/rails/generators/rails/app/app_generator.rb
+7
-0
railties/lib/rails/tasks/framework.rake
railties/lib/rails/tasks/framework.rake
+5
-1
未找到文件。
.rubocop.yml
浏览文件 @
9e34df00
...
...
@@ -135,6 +135,7 @@ Style/FrozenStringLiteralComment:
-
'
actionpack/test/**/*.builder'
-
'
actionpack/test/**/*.ruby'
-
'
activestorage/db/migrate/**/*.rb'
-
'
activestorage/db/update_migrate/**/*.rb'
-
'
actionmailbox/db/migrate/**/*.rb'
-
'
actiontext/db/migrate/**/*.rb'
...
...
activerecord/lib/active_record/railties/databases.rake
浏览文件 @
9e34df00
...
...
@@ -407,6 +407,10 @@ namespace :railties do
if
railtie
.
respond_to?
(
:paths
)
&&
(
path
=
railtie
.
paths
[
"db/migrate"
].
first
)
railties
[
railtie
.
railtie_name
]
=
path
end
unless
ENV
[
"MIGRATIONS_PATH"
].
blank?
railties
[
railtie
.
railtie_name
]
=
railtie
.
root
+
ENV
[
"MIGRATIONS_PATH"
]
end
end
on_skip
=
Proc
.
new
do
|
name
,
migration
|
...
...
activestorage/db/update_migrate/20180723000244_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.rb
0 → 100644
浏览文件 @
9e34df00
class
AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId
<
ActiveRecord
::
Migration
[
6.0
]
def
up
unless
foreign_key_exists?
(
:active_storage_attachments
,
column: :blob_id
)
add_foreign_key
:active_storage_attachments
,
:active_storage_blobs
,
column: :blob_id
end
end
end
activestorage/lib/tasks/activestorage.rake
浏览文件 @
9e34df00
...
...
@@ -12,4 +12,11 @@ namespace :active_storage do
Rake
::
Task
[
"app:active_storage:install:migrations"
].
invoke
end
end
# desc "Copy over the migrations needed to the application upgrading"
task
update: :environment
do
ENV
[
"MIGRATIONS_PATH"
]
=
"db/update_migrate"
Rake
::
Task
[
"active_storage:install"
].
invoke
end
end
railties/lib/rails/generators/rails/app/app_generator.rb
浏览文件 @
9e34df00
...
...
@@ -305,6 +305,13 @@ def update_bin_files
end
remove_task
:update_bin_files
def
update_active_storage
unless
skip_active_storage?
rails_command
"active_storage:update"
end
end
remove_task
:update_active_storage
def
create_config_files
build
(
:config
)
end
...
...
railties/lib/rails/tasks/framework.rake
浏览文件 @
9e34df00
...
...
@@ -2,7 +2,7 @@
namespace
:app
do
desc
"Update configs and some other initially generated files (or use just update:configs or update:bin)"
task
update:
[
"update:configs"
,
"update:bin"
,
"update:upgrade_guide_info"
]
task
update:
[
"update:configs"
,
"update:bin"
,
"update:
active_storage"
,
"update:
upgrade_guide_info"
]
desc
"Applies the template supplied by LOCATION=(/path/to/template) or URL"
task
template: :environment
do
...
...
@@ -51,6 +51,10 @@ namespace :app do
Rails
::
AppUpdater
.
invoke_from_app_generator
:update_bin_files
end
task
:active_storage
do
Rails
::
AppUpdater
.
invoke_from_app_generator
:update_active_storage
end
task
:upgrade_guide_info
do
Rails
::
AppUpdater
.
invoke_from_app_generator
:display_upgrade_guide_info
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录