Class: Sunspot::SessionProxy::DelayedJobSessionProxy
- Inherits:
-
AbstractSessionProxy
- Object
- AbstractSessionProxy
- Sunspot::SessionProxy::DelayedJobSessionProxy
- Defined in:
- lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb
Overview
Instance Attribute Summary collapse
-
#config ⇒ Object
writeonly
Sets the attribute config.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Class Method Summary collapse
Instance Method Summary collapse
- #batch(&block) ⇒ Object
- #commit ⇒ Object
-
#commit_if_delete_dirty ⇒ Object
We can’t delegate to @session as commit needs to be sent to delayed job.
-
#commit_if_dirty ⇒ Object
We can’t delegate to @session as commit needs to be sent to delayed job.
-
#index!(*objects) ⇒ Object
We can’t delegate to @session as commit needs to be sent to delayed job.
-
#initialize(session) ⇒ DelayedJobSessionProxy
constructor
A new instance of DelayedJobSessionProxy.
Constructor Details
#initialize(session) ⇒ DelayedJobSessionProxy
Returns a new instance of DelayedJobSessionProxy.
54 55 56 57 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 54 def initialize(session) @config = session.config @session = session end |
Instance Attribute Details
#config=(value) ⇒ Object (writeonly)
Sets the attribute config
15 16 17 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 15 def config=(value) @config = value end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
14 15 16 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 14 def session @session end |
Class Method Details
.rebuild_config(config) ⇒ Object
50 51 52 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 50 def self.rebuild_config(config) Sunspot::SessionProxy::DelayedJob::SafeConfiguration.new(config) end |
Instance Method Details
#batch(&block) ⇒ Object
21 22 23 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 21 def batch(&block) Delayed::Job.enqueue Sunspot::SessionProxy::DelayedJob::IndexingJob.new(self, :batch, &block) end |
#commit ⇒ Object
25 26 27 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 25 def commit Delayed::Job.enqueue Sunspot::SessionProxy::DelayedJob::IndexingJob.new(self, :commit) end |
#commit_if_delete_dirty ⇒ Object
We can’t delegate to @session as commit needs to be sent to delayed job.
46 47 48 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 46 def commit_if_delete_dirty commit if @session.delete_dirty? end |
#commit_if_dirty ⇒ Object
We can’t delegate to @session as commit needs to be sent to delayed job.
39 40 41 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 39 def commit_if_dirty commit if @session.dirty? end |
#index!(*objects) ⇒ Object
We can’t delegate to @session as commit needs to be sent to delayed job.
32 33 34 35 |
# File 'lib/sunspot_plus/session_proxy/delayed_job_session_proxy.rb', line 32 def index!(*objects) @session.index(*objects) commit end |