Sha256: 42c4a7ba01dfd589aee6952778080fb28006d78938acc5c124047b9ff2f297a2
Contents?: true
Size: 563 Bytes
Versions: 3
Compression:
Stored size: 563 Bytes
Contents
require "babosa" module C80NewsTz class Rubric < ActiveRecord::Base validates_with RubricValidator extend FriendlyId friendly_id :title, use: :slugged def normalize_friendly_id(input) input.to_s.to_slug.normalize(transliterations: :russian).to_s end def slug_candidates [:title] + Array.new(6) { |index| [:title, index+2] } end has_and_belongs_to_many :facts, :join_table => 'c80_news_tz_facts_rubrics' def should_generate_new_friendly_id? slug.blank? # name_changed? || super end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
c80_news_tz-0.1.1.15 | app/models/c80_news_tz/rubric.rb |
c80_news_tz-0.1.1.1 | app/models/c80_news_tz/rubric.rb |
c80_news_tz-0.1.1.0 | app/models/c80_news_tz/rubric.rb |