Can i have multiple call inside single module
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start with app/api/proj/api/v2/entities/committee.rb and compare the defined Committee and CommitteeWithSubcommittees classes with the Grape present calls. Check the corresponding standalone committee_list.rb file and determine whether the intended entity name is CommitteeWithSubcommittees or CommitteeList. Done means the intended entity can be referenced from the single file without breaking presentation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I want to have multiple classes inside grape entity file, this is the folder structure app/api/proj/api/v2/entities/committee.rb
module PROJ::API::V2::Entities
class Committee < Grape::Entity
expose :id
expose :name, :full_name, :email, :tag, :parent_id
expose :country do |entity, option|
entity.parent.name if entity.parent.present?
end
include Urls
private
def self.namespace_path
"committees"
end
end
class CommitteeWithSubcommittees < CommitteeBase
# include ProfilePhoto
expose :suboffices, with: 'PROJ::API::V2::Entities::CommitteeBase'
end
and inside the grape api
present @committees, with: PROJ::API::V2::Entities::Committee
is working. but if i present with
present @committees, with: PROJ::API::V2::Entities::CommitteeList
it is not working. But it works when i move it to a new file named committee_list.rb inside entities
- Ngôn ngữ chính
- Ruby
- Star
- 730
- Fork
- 155
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ruby-grape/grape-entity
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
ruby-grape/grape-entity#386 · 7 bình luận · 1 reaction ·
-
Custom Entity options supportĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
ruby-grape/grape-entity#382 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
ruby-grape/grape-entity#380 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
ruby-grape/grape-entity#373 · 2 bình luận ·
-
Truncate FormatterĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 45/100
ruby-grape/grape-entity#372 ·
Tất cả issue của ruby-grape/grape-entity
Issue tương tự
-
[KLayout][DRC] Gat.b1 only checks gate regions, misses facing 3.3 V poly end caps (Figure 5.6)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
IHP-GmbH/IHP-Open-PDK#1266 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Source Support
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
we-promise/sure#4056 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
valkey-io/valkey-glide-ruby#347 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 5 ngày