Class: Txtblx::Textblock

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/txtblx/textblock.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.by_key(key) ⇒ Object



20
21
22
# File 'app/models/txtblx/textblock.rb', line 20

def self.by_key(key)
  Textblock.published.find_by_key(key)
end

Instance Method Details

#publishObject



8
9
10
# File 'app/models/txtblx/textblock.rb', line 8

def publish
  snapshot!(tag: :published)
end

#to_paramObject



16
17
18
# File 'app/models/txtblx/textblock.rb', line 16

def to_param
  perma_id.to_s
end