Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VietTH-VenShop
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
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tran Hoang Viet
VietTH-VenShop
Commits
a29c7bbd
Commit
a29c7bbd
authored
Jul 03, 2015
by
Tran Hoang Viet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VietTH: Update convention
parent
7f537185
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
app/decorators/category_decorator.rb
+2
-1
app/decorators/product_decorator.rb
+2
-1
app/models/category.rb
+2
-2
No files found.
app/decorators/category_decorator.rb
View file @
a29c7bbd
...
@@ -2,6 +2,6 @@ class CategoryDecorator < Draper::Decorator
...
@@ -2,6 +2,6 @@ class CategoryDecorator < Draper::Decorator
delegate_all
delegate_all
def
title
def
title
object
.
title
||
'Uncategory'
return
object
.
title
||
'Uncategory'
end
end
end
end
\ No newline at end of file
app/decorators/product_decorator.rb
View file @
a29c7bbd
...
@@ -2,6 +2,6 @@ class ProductDecorator < Draper::Decorator
...
@@ -2,6 +2,6 @@ class ProductDecorator < Draper::Decorator
delegate_all
delegate_all
def
price
def
price
object
.
price
||
'Contact'
return
object
.
price
||
'Contact'
end
end
end
end
\ No newline at end of file
app/models/category.rb
View file @
a29c7bbd
class
Category
<
ActiveRecord
::
Base
class
Category
<
ActiveRecord
::
Base
default_scope
->
{
order
(
:title
)
}
default_scope
->
{
order
(
:title
)
}
JSON_DEFAULT
=
%i(id title)
has_many
:products
,
dependent: :destroy
has_many
:products
,
dependent: :destroy
enum
category_type:
%i(system amazon)
enum
category_type:
%i(system amazon)
JSON_DEFAULT
=
%i(id title)
end
end
\ No newline at end of file
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