Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shotengai
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
shotengai
Commits
4df7dc12
Commit
4df7dc12
authored
Aug 26, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add series & snapshot to model generator
parent
18bdb58e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
models_generator.rb
lib/generators/shotengai/models_generator.rb
+2
-0
product_series.rb
lib/generators/templates/models/product_series.rb
+2
-0
product_snapshot.rb
lib/generators/templates/models/product_snapshot.rb
+2
-0
No files found.
lib/generators/shotengai/models_generator.rb
View file @
4df7dc12
...
@@ -26,6 +26,8 @@ module Shotengai
...
@@ -26,6 +26,8 @@ module Shotengai
def
copy_models
def
copy_models
@product_name
,
@order_name
,
@catalog_name
=
options
.
values_at
(
:product
,
:order
,
:catalog
)
@product_name
,
@order_name
,
@catalog_name
=
options
.
values_at
(
:product
,
:order
,
:catalog
)
template
'product.rb'
,
"app/models/
#{
@product_name
.
underscore
}
.rb"
template
'product.rb'
,
"app/models/
#{
@product_name
.
underscore
}
.rb"
template
'product_series.rb'
,
"app/models/
#{
@product_name
.
underscore
}
_series.rb"
template
'product_snapshot.rb'
,
"app/models/
#{
@product_name
.
underscore
}
_snapshot.rb"
template
'order.rb'
,
"app/models/
#{
@order_name
.
underscore
}
.rb"
template
'order.rb'
,
"app/models/
#{
@order_name
.
underscore
}
.rb"
template
'catalog.rb'
,
"app/models/
#{
@catalog_name
.
underscore
}
.rb"
template
'catalog.rb'
,
"app/models/
#{
@catalog_name
.
underscore
}
.rb"
end
end
...
...
lib/generators/templates/models/product_series.rb
0 → 100644
View file @
4df7dc12
class
<
%= @product_name %>Series < Shotengai::Series
end
lib/generators/templates/models/product_snapshot.rb
0 → 100644
View file @
4df7dc12
class
<
%= @product_name %>Snapshot < Shotengai::Snapshot
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