models: remove creator_id from artists, notes, and pools.

Remove the creator_id field from artists, notes, and pools. The
creator_id wasn't otherwise used and was inconsistent with the
artist/note/pool history in some cases, especially for old artists.
This commit is contained in:
evazion
2020-02-16 23:02:23 -06:00
parent 207861fd40
commit 2dab9aa075
16 changed files with 23 additions and 46 deletions

View File

@@ -44,7 +44,7 @@ class ArtistsController < ApplicationController
end
def create
@artist = Artist.create(artist_params.merge(creator: CurrentUser.user))
@artist = Artist.create(artist_params)
respond_with(@artist)
end

View File

@@ -7,7 +7,7 @@ class NotesController < ApplicationController
def index
@notes = Note.paginated_search(params)
@notes = @notes.includes(:creator, :post) if request.format.html?
@notes = @notes.includes(:post) if request.format.html?
respond_with(@notes)
end
@@ -20,7 +20,7 @@ class NotesController < ApplicationController
end
def create
@note = Note.create(note_params(:create).merge(creator: CurrentUser.user))
@note = Note.create(note_params(:create))
respond_with(@note) do |fmt|
fmt.json do
if @note.errors.any?

View File

@@ -18,7 +18,6 @@ class PoolsController < ApplicationController
def index
@pools = Pool.paginated_search(params, count_pages: true)
@pools = @pools.includes(:creator) if request.format.html?
respond_with(@pools)
end
@@ -40,7 +39,7 @@ class PoolsController < ApplicationController
end
def create
@pool = Pool.create(pool_params.merge(creator: CurrentUser.user))
@pool = Pool.create(pool_params)
flash[:notice] = @pool.valid? ? "Pool created" : @pool.errors.full_messages.join("; ")
respond_with(@pool)
end