Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
b7bfdec3
Commit
b7bfdec3
authored
Mar 18, 2012
by
Dmitry Polushkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated migration generator template.
parent
32199e21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
generators/paperclip/templates/paperclip_migration.rb.erb
+2
-10
No files found.
generators/paperclip/templates/paperclip_migration.rb.erb
View file @
b7bfdec3
class
<%=
migration_name
%>
<
ActiveRecord::Migration
class
<%=
migration_name
%>
<
ActiveRecord::Migration
def
self
.
up
def
change
<%
attachments
.
each
do
|
attachment
|
-%>
<%
attachments
.
each
do
|
attachment
|
-%>
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_file_name
,
:string
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_file_name
,
:string
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_content_type
,
:string
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_content_type
,
:string
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_file_size
,
:integer
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_file_size
,
:integer
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_updated_at
,
:datetime
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_updated_at
,
:datetime
<%
end
-%>
add_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_fingerprint
,
:string
,
length:
32
end
def
self
.
down
<%
attachments
.
each
do
|
attachment
|
-%>
remove_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_file_name
remove_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_content_type
remove_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_file_size
remove_column
:
<%=
class_name
.
underscore
.
camelize
.
tableize
%>
,
:
<%=
attachment
%>
_updated_at
<%
end
-%>
<%
end
-%>
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment