mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 14:17:00 +08:00
17 lines
317 B
Ruby
17 lines
317 B
Ruby
# frozen_string_literal: true
|
|
|
|
class StepTableSerializer < ActiveModel::Serializer
|
|
include Rails.application.routes.url_helpers
|
|
|
|
attributes :name, :urls
|
|
|
|
def urls
|
|
return if object.destroyed?
|
|
|
|
object.reload unless object.step
|
|
|
|
{
|
|
delete_url: step_table_path(object.step, object)
|
|
}
|
|
end
|
|
end
|