Method: BlogCategory.by_slug

Defined in:
app/models/blog_category.rb

.by_slug(value) ⇒ Array

Returns the blog categories matching the specified slug.

Parameters:

  • the (String)

    slug to search for

Returns:

  • (Array)

    the matching blog categories



48
49
50
# File 'app/models/blog_category.rb', line 48

def self.by_slug value
  self.find :first, :conditions => {:slug => /^#{value}$/i}
end