Class: Pulitzer::Tag

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/pulitzer/tag.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.named(name = "") ⇒ Object



19
20
21
# File 'app/models/pulitzer/tag.rb', line 19

def self.named(name = "")
  find_by name: name
end

Instance Method Details

#root?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/models/pulitzer/tag.rb', line 23

def root?
  hierarchical? && parent_id.nil?
end