Skip to content

Nested Attribute Code Smells with PT/PL/MP #11

Description

@alexauritt

There seems to be some needless hackery here.

  1. There was a bug for ProblemLevel#new -- we were previously unable to add a problem level to an empty ProblemType. The current fix is to explicitly build a new problem level for the problem type (@problem_level.problem_type.problem_levels.build) in ProblemLevel#create. Shouldn't be necessary, but without it, we get a ProblemType can't be blank error, even through level.problem_type reference seems fine.

  2. ProblemType currently expliclity initializes problem levels. ( before_validation :initialize_problem_levels, :on => :create, in ProblemType model.) Seems like this shouldn't be necessary.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions