Class: Writefully::Site

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/writefully/site.rb

Constant Summary collapse

HOOK_EVENTS =
%w(push collaborator)

Instance Method Summary collapse

Instance Method Details

#clear_errorsObject



28
29
30
# File 'app/models/writefully/site.rb', line 28

def clear_errors
  Writefully.redis.with { |c| c.del("site:#{self.id}:errors") }
end

#processing_errorsObject



24
25
26
# File 'app/models/writefully/site.rb', line 24

def processing_errors
  Writefully.redis.with { |c| c.smembers "site:#{self.id}:errors" }
end

#setup_repositoryObject



18
19
20
21
22
# File 'app/models/writefully/site.rb', line 18

def setup_repository
  Writefully.add_job :handyman, { task: :build, auth_token: owner.data["auth_token"], 
                                                user_name: owner.data["user_name"],
                                                site_id: id, site_slug: slug   }
end