Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexauritt opened this issue Jul 2, 2011 · 1 comment
Open

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

alexauritt opened this issue Jul 2, 2011 · 1 comment

Comments

@alexauritt
Copy link
Owner

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.

@alexauritt
Copy link
Owner Author

Issue #2 seems to be fixed. But we're still building (@problem_level.problem_type.problem_levels.build) in ProblemLevel#create

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant