Sha256: aee0c9a7b5eabb78467cfd94d9d81313fac3937ecdc4a1489cd46d82bf1ceaee

Contents?: true

Size: 444 Bytes

Versions: 24

Compression:

Stored size: 444 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

24 entries across 24 versions & 1 rubygems

Version Path
tkh_content-0.4.7 app/models/tag.rb
tkh_content-0.9.1 app/models/tag.rb
tkh_content-0.9 app/models/tag.rb
tkh_content-0.4.6 app/models/tag.rb
tkh_content-0.4.5 app/models/tag.rb
tkh_content-0.4.4 app/models/tag.rb
tkh_content-0.4.3 app/models/tag.rb
tkh_content-0.4.2 app/models/tag.rb
tkh_content-0.3.1 app/models/tag.rb
tkh_content-0.3 app/models/tag.rb
tkh_content-0.2.1 app/models/tag.rb
tkh_content-0.2 app/models/tag.rb
tkh_content-0.1.15 app/models/tag.rb
tkh_content-0.1.14 app/models/tag.rb
tkh_content-0.1.13 app/models/tag.rb
tkh_content-0.1.12 app/models/tag.rb
tkh_content-0.1.11 app/models/tag.rb
tkh_content-0.1.10 app/models/tag.rb
tkh_content-0.1.9.3 app/models/tag.rb
tkh_content-0.1.9.2 app/models/tag.rb