small medium large xlarge

Generic-user-small
11 Feb 2015, 13:56
Vasanth Pappu (7 posts)

on pg. 47, after converting the plain old ruby object models into AR models, I get the following errors which are not mentioned:

I posted this in errata but it might be better posted here in case someone else came across the same thing and worked through a solution.

I think something else needs to be changed to have the AR models get saved (all of their values are nil); will investigate and update here.

2) Project initialization marks a project done if its task are done Failure/Error: expect(project).to be_done expected #<Project id: nil, name: nil, due_date: nil, created_at: nil, updated_at: nil>.done? to return true, got false # ./spec/models/project_spec.rb:30:in `block (3 levels) in <top (required)>’

3) Task can distinguish a complete task Failure/Error: expect(task).to be_complete expected #<Task id: nil, project_id: nil, title: nil, size: nil, completed_at: nil, created_at: nil, updated_at: nil>.complete? to return true, got false # ./spec/models/task_spec.rb:8:in `block (2 levels) in <top (required)>’

4) Task velocity counts a recently completed task toward velocity Failure/Error: expect(task).to be_part_of_velocity expected #<Task id: nil, project_id: nil, title: nil, size: 3, completed_at: nil, created_at: nil, updated_at: nil>.part_of_velocity? to return true, got false # ./spec/models/task_spec.rb:27:in `block (3 levels) in <top (required)>’

Generic-user-small
11 Feb 2015, 14:17
Vasanth Pappu (7 posts)

Resolved: I forgot to update a snippet in task.rb:

  def mark_completed(date = nil)
    # previous: 
    # @completed_at = (date || Time.current)
    #
    # converting to AR:
    self.completed_at = (date || Time.current)
  end
Ironman_pragsmall
19 May 2016, 12:11
Steve Hunter (2 posts)

Thank you for this post!

I was scratching my head with this until you pointed out the @completed_at change to self.completed_at and also the usage of that below in the complete? method, again, removing the @ symbol.

Thanks again for your post.

Steve.

You must be logged in to comment