diff --git a/app/controllers/v1/collections_controller.rb b/app/controllers/v1/collections_controller.rb index 2c8bf8df05159cf2ca8ac9b82cd2228df33c62af..21fc1f9cc49a57b0d82f7fd1e5387db4a8e07bc4 100644 --- a/app/controllers/v1/collections_controller.rb +++ b/app/controllers/v1/collections_controller.rb @@ -99,7 +99,7 @@ class V1::CollectionsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def collection_params - params.require(:collection).permit(:name, :description, :owner_id, :owner_type, :privacy, tags: []) + params.require(:collection).permit(:name, :curator, :description, :owner_id, :owner_type, :privacy, tags: []) end def extra_params diff --git a/app/serializers/collection_serializer.rb b/app/serializers/collection_serializer.rb index 94f6bf6ce48c750ca922f5861f90359671b4ff15..a5f39efb52ecc4dc451d293efb9e9a2f24edfac4 100644 --- a/app/serializers/collection_serializer.rb +++ b/app/serializers/collection_serializer.rb @@ -28,7 +28,7 @@ class CollectionSerializer < ActiveModel::Serializer thumbs end - attributes :id, :name, :created_at, :updated_at, :description, :privacy, :score, :likes_count, :liked, :followed, :reviewed, :complained, :review_average, :thumbnail, :items_thumbnails + attributes :id, :name, :curator, :created_at, :updated_at, :description, :privacy, :score, :likes_count, :liked, :followed, :reviewed, :complained, :review_average, :thumbnail, :items_thumbnails belongs_to :owner has_many :tags diff --git a/db/migrate/20170518120936_add_curator_to_collection.rb b/db/migrate/20170518120936_add_curator_to_collection.rb new file mode 100644 index 0000000000000000000000000000000000000000..29f69c17c5c0c588d4eb3cf98152b367cb921a34 --- /dev/null +++ b/db/migrate/20170518120936_add_curator_to_collection.rb @@ -0,0 +1,5 @@ +class AddCuratorToCollection < ActiveRecord::Migration[5.0] + def change + add_column :collections, :curator, :string + end +end