Sha256: d1db8808ab066904fbd46c8e39201317d47afbc72dad946d42dffddf2d9649cf

Contents?: true

Size: 155 Bytes

Versions: 5

Compression:

Stored size: 155 Bytes

Contents

class Category < ActiveRecord::Base
  has_many :products

  def self.find(*args)
    find_by_slug(*args) || super
  end

  def to_param
    slug
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gretel-trails-0.0.5 test/dummy/app/models/category.rb
gretel-trails-0.0.4 test/dummy/app/models/category.rb
gretel-trails-0.0.3 test/dummy/app/models/category.rb
gretel-trails-0.0.2 test/dummy/app/models/category.rb
gretel-trails-0.0.1 test/dummy/app/models/category.rb