Sha256: 8fd0f04d1aca241df980ab6c914345eb541a436a1c62be641f92de9f432f4a4e

Contents?: true

Size: 243 Bytes

Versions: 1

Compression:

Stored size: 243 Bytes

Contents

class <%= klass %>

  attr_accessible :body, :name, :slug

  default_scope order('created_at DESC, updated_at DESC')\n

  validates_uniqueness_of :name

  before_save :update_slug

  def update_slug
   self.slug = name.parameterize
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

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