spec/fixtures/customer_policy.rb in tram-policy-0.2.5 vs spec/fixtures/customer_policy.rb in tram-policy-0.3.0
- old
+ new
@@ -1,5 +1,8 @@
class Test::CustomerPolicy < Tram::Policy
option :name
- validate { errors.add :name_presence, field: "name" unless name }
+ validate do
+ return if name
+ errors.add :name_presence, field: "name"
+ end
end