Sha256: bcc3a66d5a76ae35c7a3343c9b5e4092c793171c9e1ffdade25521585d78dc24

Contents?: true

Size: 531 Bytes

Versions: 3

Compression:

Stored size: 531 Bytes

Contents

#
# Blogaze
# Copyright (C) 2011-2013 Jack Polgar
#
# Blogaze is released under the BSD 3-clause license.
# @license http://opensource.org/licenses/BSD-3-Clause
#

module Blogaze
  module Models
    class Tag < Sequel::Model
      ##
      # Returns the URI to the page
      # listing posts belonging to the tag.
      #
      def href
        "/tags/#{slug}"
      end

      def before_save
        self.slug = Innate::Helper::CGI.u(self.name.scan(/\w+/).join('-')).downcase
      end
    end # Tag
  end # Models
end # Blogaze

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blogaze-0.1.0 lib/blogaze/models/tag.rb
blogaze-0.0.3 lib/blogaze/models/tag.rb
blogaze-0.0.2 lib/blogaze/models/tag.rb