Commit a29c7bbd by Tran Hoang Viet

VietTH: Update convention

parent 7f537185
......@@ -2,6 +2,6 @@ class CategoryDecorator < Draper::Decorator
delegate_all
def title
object.title || 'Uncategory'
return object.title || 'Uncategory'
end
end
\ No newline at end of file
......@@ -2,6 +2,6 @@ class ProductDecorator < Draper::Decorator
delegate_all
def price
object.price || 'Contact'
return object.price || 'Contact'
end
end
\ No newline at end of file
class Category < ActiveRecord::Base
default_scope ->{ order(:title) }
JSON_DEFAULT = %i(id title)
has_many :products, dependent: :destroy
enum category_type: %i(system amazon)
JSON_DEFAULT = %i(id title)
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment