Merging in both neubloc/cancan and ricec/cancan changes to work with rails4.

ActiveRecord relation is not an Array, and ensuring a table_name exists when using multiple nested attributes.