modified the models as attr_accesible is no longer used in Rails 4.