mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 01:44:34 +08:00
Merge pull request #2778 from okriuchykhin/ok_SCI_4911
Add created_at and user to API Step serializer [SCI-4911]
This commit is contained in:
commit
1080ad2821
2 changed files with 3 additions and 2 deletions
|
@ -59,7 +59,7 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def permitted_includes
|
def permitted_includes
|
||||||
%w(tables assets checklists checklists.checklist_items comments)
|
%w(tables assets checklists checklists.checklist_items comments user)
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_step_for_managing
|
def load_step_for_managing
|
||||||
|
|
|
@ -8,8 +8,9 @@ module Api
|
||||||
include InputSanitizeHelper
|
include InputSanitizeHelper
|
||||||
|
|
||||||
type :steps
|
type :steps
|
||||||
attributes :id, :name, :description, :position, :completed
|
attributes :id, :name, :description, :created_at, :position, :completed
|
||||||
attribute :completed_on, if: -> { object.completed? }
|
attribute :completed_on, if: -> { object.completed? }
|
||||||
|
belongs_to :user, serializer: UserSerializer
|
||||||
belongs_to :protocol, serializer: ProtocolSerializer
|
belongs_to :protocol, serializer: ProtocolSerializer
|
||||||
has_many :assets, serializer: AssetSerializer
|
has_many :assets, serializer: AssetSerializer
|
||||||
has_many :checklists, serializer: ChecklistSerializer
|
has_many :checklists, serializer: ChecklistSerializer
|
||||||
|
|
Loading…
Reference in a new issue