mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 23:11:42 +00:00
metadataorder
This commit is contained in:
parent
3f6319e090
commit
c8bf7eba21
1 changed files with 10 additions and 0 deletions
10
app/models/metadata_order.rb
Normal file
10
app/models/metadata_order.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Un campo de orden
|
||||
class MetadataOrder < MetadataTemplate
|
||||
# El valor según la posición del post en la relación, siguiendo el
|
||||
# orden cronológico inverso
|
||||
def default_value
|
||||
site.posts(lang: post.lang.value).index(post)
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue