Class: Pulitzer::Tag

Inherits:
ApplicationRecord show all
Defined in:
app/models/pulitzer/tag.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationRecord

assoc_name, attrs_name, convert_hash_to_nested, convert_nested_assoc

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