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



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

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

Instance Method Details

#root?Boolean

Returns:

  • (Boolean)


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

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