Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak: adds services expansion to issues and subscribers #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/controllers/issues_api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
action :all do
action do
issues = Issue.ordered.includes(:service_status, :user)
issues.map { |i| structure(i, :full => true, :expansions => [:user, :service_status]) }
issues.map { |i| structure(i, :full => true, :expansions => [:user, :service_status, :services => {:full => true}]) }
end
end

Expand Down
2 changes: 1 addition & 1 deletion api/controllers/subscribers_api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
else
error :parameter_error, "Must provide `email_address` or `verification_token` parameter"
end
structure subscriber, :full => true
structure subscriber, :full => true, :expansions => true
end
end

Expand Down
2 changes: 2 additions & 0 deletions api/structures/issue_api_structure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
structure(o.user)
end

expansion :services, :structure => :service

expansion :service_status do
structure(o.service_status)
end
Expand Down
2 changes: 2 additions & 0 deletions api/structures/subscriber_structure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
full :verified_at
full :created_at
full :updated_at

expansion :services, :structure => :service
end