accepts-flattened-values is mixin for ActiveRecord that flattens single values from a has_many or has_and_belongs_to_many assocation into a string and vice versa.
Samuel Kadolph
gem "accepts-flattened-values", "~> 0.1.3"