Sha256: b9612bdd77858521be21c2edea83cba1735c18c121082baf0355ffeb22bac4cc

Contents?: true

Size: 220 Bytes

Versions: 2

Compression:

Stored size: 220 Bytes

Contents

class Admin < ActiveRecord::Base
  acts_as_amico :amico_key => "name"
  validates_uniqueness_of :name
  before_validation :set_name

  private

  def set_name
    self.name = "Admin_#{random}" if not self.name
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_amico-0.1.1 spec/dummy/app/models/admin.rb
acts_as_amico-0.1.0 spec/dummy/app/models/admin.rb