Permalink
Browse files

+ Tests work again, no valid? before save

  • Loading branch information...
1 parent 4251a89 commit 7cac4b55d6ea90bc7e87ae00441d1b8f5eeb64f1 @kschiess committed Sep 2, 2011
Showing with 2 additions and 6 deletions.
  1. +0 −4 lib/floor_manager/employee.rb
  2. +1 −1 lib/floor_manager/employee/dsl.rb
  3. +1 −1 spec/support/model/spy.rb
@@ -27,10 +27,6 @@ def create(floor, overrides)
produce_instance.tap { |i|
apply_attributes(i, :none, floor, overrides)
- unless i.valid?
- err_msgs = i.errors.to_a.join(',')
- fail "#{@klass_name.inspect} not constructed valid: #{err_msgs}"
- end
i.save or fail "Could not create instance of #{@klass_name.inspect}."
unless @attributes[:after_create].empty?
@@ -30,7 +30,7 @@ def initialize(employee, filter=:none, &block)
# Register actions to be taken if the object gets saved (floor#create)
#
def after_create(&block)
- FloorManager::Employee::DSL.new(@employee, :after_create, &block)
+ DSL.new(@employee, :after_create, &block)
end
# This method missing handles several magic incantations:
@@ -16,7 +16,7 @@ def self.build(attrs={})
def initialize
@saved = false
end
- def save!; @saved = true; end
+ def save; @saved = true; end
def saved?; @saved; end
class Builder < Array

0 comments on commit 7cac4b5

Please sign in to comment.