mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-12 15:57:45 +08:00
standardized serializers by removing specified attributes
This commit is contained in:
parent
94a7868d6e
commit
43e6524392
7 changed files with 9 additions and 15 deletions
|
@ -4,8 +4,8 @@ module Api
|
|||
module V1
|
||||
class ActivitySerializer < ActiveModel::Serializer
|
||||
type :activities
|
||||
attributes :id, :my_module_id, :user_id, :type_of, :message, :created_at,
|
||||
:updated_at, :project_id, :experiment_id
|
||||
attributes :id, :my_module_id, :user_id, :type_of, :message,
|
||||
:project_id, :experiment_id
|
||||
belongs_to :my_module, serializer: MyModuleSerializer, optional: true
|
||||
belongs_to :experiment, serializer: ExperimentSerializer, optional: true
|
||||
belongs_to :project, serializer: ProjectSerializer
|
||||
|
|
|
@ -4,8 +4,7 @@ module Api
|
|||
module V1
|
||||
class ExperimentSerializer < ActiveModel::Serializer
|
||||
type :experiments
|
||||
attributes :id, :name, :description, :project_id, :created_by_id,
|
||||
:archived, :created_at, :updated_at
|
||||
attributes :id, :name, :description, :created_by_id, :archived
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ module Api
|
|||
module V1
|
||||
class MyModuleGroupSerializer < ActiveModel::Serializer
|
||||
type :task_groups
|
||||
attributes :id, :created_at, :updated_at, :created_by_id, :experiment_id
|
||||
attributes :id, :created_by_id, :experiment_id
|
||||
belongs_to :experiment, serializer: ExperimentSerializer
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,8 +4,7 @@ module Api
|
|||
module V1
|
||||
class ProjectCommentSerializer < ActiveModel::Serializer
|
||||
type :project_comments
|
||||
attributes :id, :message, :user_id, :created_at, :updated_at,
|
||||
:last_modified_by_id, :type, :associated_id
|
||||
attributes :id, :message, :user_id, :type, :associated_id
|
||||
|
||||
belongs_to :project, serializer: ProjectSerializer
|
||||
end
|
||||
|
|
|
@ -4,10 +4,8 @@ module Api
|
|||
module V1
|
||||
class ProjectSerializer < ActiveModel::Serializer
|
||||
type :projects
|
||||
attributes :id, :name, :visibility, :due_date, :team_id, :created_at,
|
||||
:updated_at, :archived, :archived_on, :created_by_id,
|
||||
:last_modified_by_id, :archived_by_id, :restored_by_id,
|
||||
:restored_on, :experiments_order
|
||||
attributes :id, :name, :visibility, :due_date,
|
||||
:archived, :experiments_order
|
||||
|
||||
belongs_to :team, serializer: TeamSerializer
|
||||
end
|
||||
|
|
|
@ -4,8 +4,7 @@ module Api
|
|||
module V1
|
||||
class ReportSerializer < ActiveModel::Serializer
|
||||
type :reports
|
||||
attributes :id, :name, :description, :project_id, :user_id, :created_at,
|
||||
:updated_at, :last_modified_by_id, :team_id
|
||||
attributes :id, :name, :description, :project_id
|
||||
|
||||
belongs_to :project, serializer: ProjectSerializer
|
||||
end
|
||||
|
|
|
@ -4,8 +4,7 @@ module Api
|
|||
module V1
|
||||
class UserProjectSerializer < ActiveModel::Serializer
|
||||
type :user_projects
|
||||
attributes :id, :role, :user_id, :project_id, :created_at, :updated_at,
|
||||
:assigned_by_id
|
||||
attributes :id, :role, :user_id
|
||||
|
||||
belongs_to :project, serializer: ProjectSerializer
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue