Custom fields code review


(Aaron Russell) #1

Hey @jordelver, as I know you love laughing at reviewing other people’s code, I wondered if you’d like to take a look at the custom field stuff, if you have time?

I want to be confident that the implementation makes sense to someone other than me (and it’s doesn’t totally make sense to me). So I’d just appreciate a second opinion and any thoughts really.

The best place to start looking is core/app/models/concerns/push_type/customizable.rb and just try to understand what happens when you call the field class method on a node.

Each field has a class (found in core/app/fields) and a view (which is rendered by the admin UI - found in admin/app/views/push_type/fields). Each field class inherits from PushType::FieldType and some include some other modules.

If you have time, see if you can wrap your head round how I’ve done this. There’s quite a lot going on, and to be honest some of the more complicated field types have made the code a bit urrrggh… :confounded:

I think there’s definitely room for improvement, but just need to get another view on it all really.


(Aaron Russell) #2