Sha256: d8bd1fad78f7cc7555ae8c1c9179f9a4d4a5df1527a3be4aa2ea4ba817450775

Contents?: true

Size: 199 Bytes

Versions: 6

Compression:

Stored size: 199 Bytes

Contents

class Article < ActiveRecord::Base
  acts_as_routable \
    scope: -> { where(published: true) },
    name: :custom_name
    
  def custom_name
    self.title.try(:parameterize) || self.id
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
flowmor_router-0.2.6 test/dummy/app/models/article.rb
flowmor_router-0.2.5 test/dummy/app/models/article.rb
flowmor_router-0.2.4 test/dummy/app/models/article.rb
flowmor_router-0.2.3 test/dummy/app/models/article.rb
flowmor_router-0.2.2 test/dummy/app/models/article.rb
flowmor_router-0.2.1 test/dummy/app/models/article.rb