Did some general ruby styling (used map over collect, etc.)

Added validations for join models