Conversation
GitHub says that this cannot be automatically merged -- you might need to rebase up to current rails3 branch? |
Hmm, I'll need to rebase again. There are a few more commits. |
def force_delete? | ||
!params[:force_delete].nil? && params[:force_delete] == "true" | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it help to check for the Boolean true
in addition to its String representation?
We could also DRY this a bit with
[:force_create, :force_update, :force_delete].each do |param|
self.class.send(:define_method, (param.to_s+"?").to_sym) do
!params[param].nil? && (params[param] == "true" || param[param] == true)
end
end
I'm not sure if this detracts from readability though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I simplified the conditions. The "!params[:force_xyz].nil?" was redundant.
- if possible I'd keep the "def force_xyz? ... end" structure. IMHO, it's more readable than your version with 'self.class.send' and it's easier to find definition of such method. However, if you insist on it I can change it. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think the Boolean true
should be checked in addition to its String representation? "params[:force_xyz]" should always contain a String.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The update is much better.
I've just done a cursory examination of the content. I'll dive in today. |
At first glance, it feels like we have a lot of duplication between I'm going to spend a bit digging in to determine if that's just perception or if we can maybe reduce duplication. |
I will sometimes get this error when trying to delete a node from a group
This does not happen with the normal |
The problem with lib/has_many_through_dependent has been fixed in #207 and that's already merged in rails3. This PR should be rebased and the problem will be gone. |
ah cool, ok. |
Confirmed that merge does indeed fix the problem; however, now I seem to get
as the content returned when I edit a node... |
…de 'Parameters' were renamed to 'Variables'
…ucts were replaced with Hashes.
Prior to this commit, the membership controllers had virtually the same code for `update` and `delete`. This commit abstracts away the differences to have a single source of truth for the respective logic.
Jeff, I cannot reproduce the problem with the displayed json content. Could you provide exact steps to reproduce it? |
@kbrezina the problem started when I locally merged the PR into the |
Turns out I had stale precompiled assets from before merging. Accurately detecting conflicts now. I'm gonna do one more once over on the code. |
@fhrbek @kbrezina, I saw this demoed by @jeffweiss today. This is awesome! Thank you so much for getting this in. |
Class Parameters
Class parameter changes were tweaked to be in compliance with Rails 3.