Skip to content

Commit

Permalink
Fixing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Jul 14, 2024
2 parents ad12c5e + c92ef6b commit e5eac09
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/graph/types/fact_check_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ class FactCheckType < DefaultObject
field :tags, [GraphQL::Types::String, null: true], null: true
field :rating, GraphQL::Types::String, null: true
field :imported, GraphQL::Types::Boolean, null: true
field :report_status, GraphQL::Types::String, null: true
end
8 changes: 4 additions & 4 deletions app/models/fact_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ def text_fields
end

def project_media
self.claim_description&.project_media
self.claim_description.project_media
end

def team_id
self.project_media&.team_id
self.claim_description.team_id
end

private

def set_language
languages = self.project_media&.team&.get_languages || ['en']
languages = self.claim_description.team.get_languages || ['en']
self.language = languages.length == 1 ? languages.first : 'und'
end

Expand All @@ -41,7 +41,7 @@ def set_imported
end

def language_in_allowed_values
allowed_languages = self.project_media&.team&.get_languages || ['en']
allowed_languages = self.claim_description.team.get_languages || ['en']
allowed_languages << 'und'
errors.add(:language, I18n.t(:"errors.messages.invalid_article_language_value")) unless allowed_languages.include?(self.language)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddUniqueIndexToExplainerItems < ActiveRecord::Migration[6.1]
def change
add_index :explainer_items, [:explainer_id, :project_media_id], unique: true
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_07_13_012502) do
ActiveRecord::Schema.define(version: 2024_07_14_051039) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -309,6 +309,7 @@
t.bigint "project_media_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["explainer_id", "project_media_id"], name: "index_explainer_items_on_explainer_id_and_project_media_id", unique: true
t.index ["explainer_id"], name: "index_explainer_items_on_explainer_id"
t.index ["project_media_id"], name: "index_explainer_items_on_project_media_id"
end
Expand Down
1 change: 1 addition & 0 deletions lib/relay.idl
Original file line number Diff line number Diff line change
Expand Up @@ -8388,6 +8388,7 @@ type FactCheck implements Node {
language: String
permissions: String
rating: String
report_status: String
summary: String
tags: [String]
title: String
Expand Down
4 changes: 3 additions & 1 deletion lib/rss_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def get_articles(count = 3)
feed = RSS::Parser.parse(rss, false)
unless feed.nil?
feed.items.first(count).each do |item|
output << item.title.strip + "\n" + item.link.strip
title = item.title.kind_of?(String) ? item.title : item.title.content
link = item.link.kind_of?(String) ? item.link : item.link.href
output << title.to_s.strip + "\n" + link.to_s.strip
end
end
end
Expand Down
14 changes: 14 additions & 0 deletions public/relay.json
Original file line number Diff line number Diff line change
Expand Up @@ -45423,6 +45423,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "report_status",
"description": null,
"args": [

],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "summary",
"description": null,
Expand Down

0 comments on commit e5eac09

Please sign in to comment.