Permalink
Browse files

. Conditional after_create

  • Loading branch information...
1 parent 58a37b8 commit cf6559dafbb442db76f3529ece9eec26df5d91c1 @kschiess committed Jun 4, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/floor_manager/employee.rb
@@ -27,7 +27,12 @@ def create(floor, overrides)
produce_instance.tap { |i|
apply_attributes(i, :none, floor, overrides)
i.save!
- apply_attributes(i, :after_create, floor) }
+
+ unless @attributes[:after_create].empty?
+ apply_attributes(i, :after_create, floor)
+ i.save!
+ end
+ }
end
# Returns just the attributes that would be used.

0 comments on commit cf6559d

Please sign in to comment.