Skip to content

Commit

Permalink
rt index multi support
Browse files Browse the repository at this point in the history
  • Loading branch information
bibendi committed Apr 12, 2013
1 parent 66b580a commit 57ba0d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,22 @@ module RealtimeIndex
included do
attr_accessor :rt_attr_multi
alias_method_chain :initialize, :custom_fields

class << self
alias_method_chain :settings, :custom_fields
end
end

def initialize_with_custom_fields(name)
@rt_attr_multi = []
initialize_without_custom_fields(name)
end

module ClassMethods
def settings_with_custom_fields
settings_without_custom_fields + [:rt_attr_multi]
end
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sphinx/integration/extensions/thinking_sphinx/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def to_riddle_for_rt(delta = false)
index.rt_field = fields.map(&:unique_name)
attributes.each do |attr|
attr_type = case attr.type
when :integer then :rt_attr_uint
when :integer, :boolean then :rt_attr_uint
when :bigint then :rt_attr_bigint
when :float then :rt_attr_float
when :datetime then :rt_attr_timestamp
Expand Down

0 comments on commit 57ba0d0

Please sign in to comment.