Sha256: aacf6979dfb913d7f6a9e9ac18362bbc4c06e0294ebc45e598e9316a93bc4dc1

Contents?: true

Size: 262 Bytes

Versions: 2

Compression:

Stored size: 262 Bytes

Contents

class <%= klass %> < ActiveRecord::Base

  attr_accessible :body, :name, :slug

  default_scope order('created_at DESC, updated_at DESC')

  validates_uniqueness_of :name

  before_save :update_slug

  def update_slug
   self.slug = name.parameterize
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
buildybuild-1.1.0 lib/generators/buildybuild/cms/templates/cms_model.rb
buildybuild-0.0.1 lib/generators/buildybuild/cms/templates/cms_model.rb