Skip to content

Commit

Permalink
Adding a 1.9 patch, thanks to Ivan Ukhov - making Array() work with F…
Browse files Browse the repository at this point in the history
…auxColumns.
  • Loading branch information
pat committed Apr 9, 2010
1 parent 583e61f commit f7e8ee8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.textile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ Since I first released this library, there's been quite a few people who have su
* Brad Sumersford * Brad Sumersford
* Amir Yalon * Amir Yalon
* Edgars Beigarts * Edgars Beigarts
* Ivan Ukhov
4 changes: 4 additions & 0 deletions lib/thinking_sphinx/index/faux_column.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def is_string?
@name.is_a?(String) && @stack.empty? @name.is_a?(String) && @stack.empty?
end end


def to_ary
[self]
end

# This handles any 'invalid' method calls and sets them as the name, # This handles any 'invalid' method calls and sets them as the name,
# and pushing the previous name into the stack. The object returns # and pushing the previous name into the stack. The object returns
# itself. # itself.
Expand Down
8 changes: 7 additions & 1 deletion spec/thinking_sphinx/index/faux_column_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@
] ]
end end
end end
end
describe '#to_ary' do
it "should return an array with the instance inside it" do
subject.to_ary.should == [subject]
end
end
end

0 comments on commit f7e8ee8

Please sign in to comment.