Sha256: 7a28657d7a5d00c5b32452028f784f20d247b23e39a410508994ea0928db221e

Contents?: true

Size: 600 Bytes

Versions: 20

Compression:

Stored size: 600 Bytes

Contents

require 'babosa'

module C80Yax
  class Cat < ActiveRecord::Base

    include C80Yax::Mixins::Cat::Database

    validates :title,
              presence: true,
              uniqueness: true,
              length: { in: 6..50 }

    has_and_belongs_to_many :strsubcats
    mount_uploader :image, IcatUploader

    extend FriendlyId
    friendly_id :slug_candidates, :use => :slugged

    def slug_candidates
      [:title] + Array.new(6) {|index| [:title, index+2]}
    end

    def normalize_friendly_id(input)
      input.to_s.to_slug.normalize(transliterations: :russian).to_s
    end

  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
c80_yax-0.1.0.25 app/models/c80_yax/cat.rb
c80_yax-0.1.0.24 app/models/c80_yax/cat.rb
c80_yax-0.1.0.23 app/models/c80_yax/cat.rb
c80_yax-0.1.0.22 app/models/c80_yax/cat.rb
c80_yax-0.1.0.21 app/models/c80_yax/cat.rb
c80_yax-0.1.0.20 app/models/c80_yax/cat.rb
c80_yax-0.1.0.18 app/models/c80_yax/cat.rb
c80_yax-0.1.0.17 app/models/c80_yax/cat.rb
c80_yax-0.1.0.16 app/models/c80_yax/cat.rb
c80_yax-0.1.0.15 app/models/c80_yax/cat.rb
c80_yax-0.1.0.14 app/models/c80_yax/cat.rb
c80_yax-0.1.0.13 app/models/c80_yax/cat.rb
c80_yax-0.1.0.12 app/models/c80_yax/cat.rb
c80_yax-0.1.0.11 app/models/c80_yax/cat.rb
c80_yax-0.1.0.10 app/models/c80_yax/cat.rb
c80_yax-0.1.0.9 app/models/c80_yax/cat.rb
c80_yax-0.1.0.8 app/models/c80_yax/cat.rb
c80_yax-0.1.0.7 app/models/c80_yax/cat.rb
c80_yax-0.1.0.6 app/models/c80_yax/cat.rb
c80_yax-0.1.0.5 app/models/c80_yax/cat.rb