Fix issue where only approved orgs could make CTAs (#1017)
* Fix issue where only approved orgs could make CTAs * Adjust articles api
This commit is contained in:
parent
db9c16db4d
commit
f4f4af776c
2 changed files with 6 additions and 4 deletions
|
|
@ -62,9 +62,11 @@ class OrganizationsController < ApplicationController
|
|||
text_color_hex
|
||||
twitter_username
|
||||
github_username
|
||||
cta_button_text
|
||||
cta_button_url
|
||||
cta_body_markdown
|
||||
]
|
||||
approved_params = %i(cta_button_text cta_button_url cta_body_markdown)
|
||||
@organization&.approved ? accessible + approved_params : accessible
|
||||
accessible
|
||||
end
|
||||
|
||||
def organization_params
|
||||
|
|
|
|||
|
|
@ -84,10 +84,10 @@ class ArticleApiIndexService
|
|||
def state_articles(state)
|
||||
if state == "fresh"
|
||||
Article.where(published: true).
|
||||
where("positive_reactions_count < ? AND featured_number > ?", 5, 7.hours.ago.to_i)
|
||||
where("positive_reactions_count < ? AND featured_number > ? AND score > ?", 3, 7.hours.ago.to_i, -2)
|
||||
elsif state == "rising"
|
||||
Article.where(published: true).
|
||||
where("positive_reactions_count > ? AND positive_reactions_count < ? AND featured_number > ?", 19, 27, 3.days.ago.to_i)
|
||||
where("positive_reactions_count > ? AND positive_reactions_count < ? AND featured_number > ?", 19, 33, 3.days.ago.to_i)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue