Class: Category

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/opensprints-core/category.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_after(other) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/opensprints-core/category.rb', line 6

def Category.next_after(other)
  if(other)
    category = Category.filter(:id > other.pk).order(:id).first
  else
    category = Category.order(:id).first
  end
  category ? category.pk : nil
end

Instance Method Details

#to_sObject



2
3
4
# File 'lib/opensprints-core/category.rb', line 2

def to_s
  self.name
end