Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

. Conditional after_create

  • Loading branch information...
commit cf6559dafbb442db76f3529ece9eec26df5d91c1 1 parent 58a37b8
Kaspar Schiess authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/floor_manager/employee.rb
7 lib/floor_manager/employee.rb
View
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.