Skip to content

Commit

Permalink
Minor code formatting improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasleese committed Dec 23, 2016
1 parent 4f178c3 commit 8f180a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions app/commands/v2/discard_draft.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,14 @@ def increment_live_lock_version

def draft
@draft ||= ContentItem.joins(:document).find_by(
'documents.content_id': content_id,
'documents.locale': locale,
documents: { content_id: content_id, locale: locale },
state: "draft",
)
end

def live
@live ||= ContentItem.joins(:document).find_by(
'documents.content_id': content_id,
'documents.locale': locale,
documents: { content_id: content_id, locale: locale },
state: %w(published unpublished),
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/commands/v2/patch_link_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def schema_validator

def schema_name
@schema_name ||= Queries::GetLatest.(
ContentItem.where('documents.content_id': payload[:content_id])
ContentItem.where(documents: { content_id: content_id })
).pluck(:schema_name).first
end
end
Expand Down
3 changes: 1 addition & 2 deletions app/commands/v2/post_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def action_type

def find_content_item
content_item = ContentItem.joins(:document).find_by(
'documents.content_id': content_id,
'documents.locale': locale,
documents: { content_id: content_id, locale: locale },
state: draft? ? %w(draft) : %w(published unpublished),
)

Expand Down

0 comments on commit 8f180a9

Please sign in to comment.