Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
[chaos] Remove unused document's fields
Browse files Browse the repository at this point in the history
  • Loading branch information
malev committed Feb 1, 2015
1 parent b645467 commit 8f8f487
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions chaos/lib/mapa76/core/model/document.rb
Expand Up @@ -11,11 +11,8 @@ class Document
field :original_filename, type: String
field :context_cache, type: Hash, default: {}
field :processed_text, type: String
field :process_attemps, type: Integer, default: 0
field :status, type: String, default: ''
field :status_msg, type: String, default: ''
field :status_history, type: Array, default: []
field :tasks, type: Array, default: []
field :public, type: Boolean, default: true
field :percentage, type: Float, default: 0
field :flagger_id, type: Moped::BSON::ObjectId
Expand Down Expand Up @@ -45,13 +42,11 @@ class Document
scope :private_for, ->(user){ where(:user_id => user.id, :public => false) }
scope :listing, -> { without([
:processed_text, :named_entity_ids, :person_ids,
:organization_ids, :place_ids, :date_entity_ids,
:process_attemps, :status_history, :tasks, :public]) }
:organization_ids, :place_ids, :date_entity_ids]) }
scope :minimal, -> { without([
:processed_text, :named_entity_ids, :person_ids,
:organization_ids, :place_ids, :date_entity_ids,
:url, :original_filename, :context_cache, :process_attemps,
:status_history, :tasks, :public]) }
:url, :original_filename, :context_cache]) }

index({ created_at: -1, user_id: 1}, { unique: true })

Expand Down Expand Up @@ -154,7 +149,6 @@ def process!

def process_text!
update_attribute :status, 'text_extraction_task-end'
update_attribute :status_history, ['text_extraction_task']
Resque.enqueue(SchedulerTask, {metadata: { document_id: self.id}}.to_json)
end

Expand All @@ -175,7 +169,6 @@ def document_type
def restart_variables
update_attribute :percentage, 0
update_attribute :status, ''
update_attribute :status_history, []
end

def context_generator
Expand Down

0 comments on commit 8f8f487

Please sign in to comment.