spec/dummy/app/models/admin.rb in acts_as_amico-0.1.1 vs spec/dummy/app/models/admin.rb in acts_as_amico-0.2.0
- old
+ new
@@ -1,11 +1,5 @@
class Admin < ActiveRecord::Base
- acts_as_amico :amico_key => "name"
+ 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
+ validates_presence_of :name
end