Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding placeholders to ThinkingSphinx::DataMapper, further neatening …
…of ThinkingSphinx::ActiveRecord.
- Loading branch information
Showing
2 changed files
with
92 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,42 @@ | ||
module ThinkingSphinx::DataMapper | ||
def self.included(base) | ||
base.class_eval do | ||
extend ThinkingSphinx::DataMapper::ClassMethods | ||
end | ||
end | ||
|
||
module ClassMethods | ||
private | ||
|
||
def add_initial_sphinx_callbacks | ||
super | ||
|
||
# before_validation :process_indexes | ||
# before_destroy :process_indexes | ||
end | ||
|
||
def add_standard_sphinx_callbacks | ||
super | ||
|
||
# after_destroy :toggle_deleted | ||
|
||
# include ThinkingSphinx::ActiveRecord::AttributeUpdates | ||
end | ||
|
||
def add_delta_sphinx_callbacks | ||
super | ||
|
||
# before_save :toggle_delta | ||
# after_commit :index_delta | ||
end | ||
end | ||
|
||
def primary_key_for_sphinx | ||
id | ||
end | ||
end | ||
|
||
DataMapper::Resource.class_eval do | ||
include ThinkingSphinx::Base | ||
include ThinkingSphinx::DataMapper | ||
end |