Sha256: 230f18a51a7eb04da0a66d7de9c74ce32717d11f37d4d62fa59114dada2861d9

Contents?: true

Size: 443 Bytes

Versions: 6

Compression:

Stored size: 443 Bytes

Contents

# this is needed for now to make mass assignment security compatible with the translation of globalize3
# Globalize::ActiveRecord::Translation.class_eval do
#   attr_accessible :locale
# end

class Tag < ActiveRecord::Base

  # attr_accessible :name

  has_many :taggings
  has_many :pages, through: :taggings

  translates :name

  scope :alphabetically, -> { order('name') }

  def to_param
    name ? "#{id}-#{name.to_url}" : id
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tkh_content-0.9.7 app/models/tag.rb
tkh_content-0.9.6 app/models/tag.rb
tkh_content-0.9.5 app/models/tag.rb
tkh_content-0.9.4 app/models/tag.rb
tkh_content-0.9.3 app/models/tag.rb
tkh_content-0.9.2 app/models/tag.rb