Sha256: 3bac793d5366e18b21830ee40a7b05742fddd75b53fa638ac1864247177830cd

Contents?: true

Size: 310 Bytes

Versions: 32

Compression:

Stored size: 310 Bytes

Contents

module Pulitzer
  module PostTypeElement
    def self.included(klass)
      klass.before_save :handle_sort_order
    end

    def highest_sibling_sort
      self.post_type_version.highest_element_sort
    end

    def handle_sort_order
      self.sort_order ||= self.highest_sibling_sort + 1
    end

  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
pulitzer-0.15.31 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.30 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.29 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.28 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.27 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.26 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.25 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.24 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.23 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.22 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.21 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.20 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.19 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.18 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.17 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.16 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.15 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.14 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.13 app/models/pulitzer/post_type_element.rb
pulitzer-0.15.12 app/models/pulitzer/post_type_element.rb