File tree 3 files changed +19
-59
lines changed
3 files changed +19
-59
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ def show
10
10
end
11
11
12
12
def create
13
- forbidden
13
+ allow_create
14
14
end
15
15
16
16
def update
17
- forbidden
17
+ allow_update
18
18
end
19
19
20
20
def destroy
@@ -31,58 +31,18 @@ def serializer_klass
31
31
V1 ::Admin ::FeatureSerializer
32
32
end
33
33
34
- def creatable_attributes
35
- %[]
36
- # %i[
37
- # name
38
- # company
39
- # email
40
- # mobile
41
- # message
42
- # purpose
43
- # source
44
- # ip
45
- # ip_region
46
- # ip_city
47
- # ]
48
- end
49
-
50
- def creatable_relationships
51
- %[]
52
- # %i[
53
- # country
54
- # ip_country
55
- # ]
56
- end
57
-
58
34
def permitted_filters
59
- %[]
60
- # %i[
61
- # main_group_id
62
- # sub_group_id
63
- # ]
64
- end
65
-
66
- def permanent_filters
67
- { }
68
- # {
69
- # public: true
70
- # }
35
+ %i[
36
+ category
37
+ ]
71
38
end
72
39
73
40
def permitted_includes
74
- %[]
75
- # %i[
76
- # related_articles
77
- # related_products
78
- # related_products.main_group
79
- # translations
80
- # ]
41
+ %i[
42
+ products
43
+ products.image
44
+ ]
81
45
end
82
-
83
- # def after_create(lead)
84
- # PostLeadToSlackJob.perform_later lead
85
- # end
86
46
end
87
47
end
88
48
end
Original file line number Diff line number Diff line change 1
1
module V1
2
2
module Admin
3
3
class FeatureSerializer < ApplicationSerializer
4
- # attributes :slug,
5
- # :name,
6
- # :public
4
+ attributes :slug ,
5
+ :text ,
6
+ :icon ,
7
+ :gist ,
8
+ :category ,
9
+ :has_page
7
10
8
- # belongs_to :thing
9
- # belongs_to :main_group, record_type: :product_group, serializer: :product_group
10
- # belongs_to :sub_group, record_type: :product_group, serializer: :product_group
11
-
12
- # has_many :things
13
- # has_many :related_products, record_type: :product, serializer: :related_products
14
- # has_many :related_articles, record_type: :article, serializer: :related_articles
11
+ has_many :products , if : Proc . new { |record , params |
12
+ params && params [ 'include' ] && params [ 'include' ] . split ( ',' ) . include? ( 'products' )
13
+ }
15
14
end
16
15
end
17
16
end
Original file line number Diff line number Diff line change 42
42
resources :countries
43
43
resources :documents
44
44
resources :document_categories , path : '/document-categories'
45
+ resources :features
45
46
resources :images
46
47
resources :languages
47
48
resources :leads
You can’t perform that action at this time.
0 commit comments