Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issues with Ruby 1.8.7, etc... #156

Merged
merged 11 commits into from
Apr 24, 2012
Merged

Conversation

johndouthat
Copy link
Contributor

Thank you so much for Searchlogic. It's really great. I'm using it in several apps.

  • Fixes an issue with Searchlogic::ActiveRecord::Scope#scopes
  • Fixes a Ruby 1.8.7 compatibility issue in Searchlogic::Search::Conditions#compatct_conditions
  • Adds Appraisal support for testing multiple versions of ActiveRecord at once
  • Backed up AR support from 2.3.11 to 2.3.9. Now the specs pass with ActiveRecord 2.3.9 - 2.3.14 on Ruby 1.9.3-p125, 1.9.2-p318, and 1.8.7-p358
  • Adds some specs for coverage
  • fixes documentation and problem in alias_scope
  • Mucks with the gemfile a little bit. Sorry about that!

I'm going to try to work on Rails 3.2 compatibility in the near future, but for now I hope these changes help.

"should inherit alias scopes from superclasses" creates an anonymous subclass for its test. Anonymous classes return nil for .name by default.
It passed in 1.9 because Searchlogic::ActiveRecord::Scope#scopes's monkey patched `include?` was inadvertantly calling .respond_to?(key) on `result` instead of the AR class. In 1.8.7, it resulted in a syntax error `unexpected '.', expecting kEND` in `.respond_to?(key)` because name was nil. So, instead of looking up the AR class by name, now a reference to the class is passed in.
compact_conditions "should remove conditions with blank values". In Ruby 1.9, Hash#select returns a hash, but in 1.8, it returns an array of key/value pair arrays.
…liasing scopes by symbol that have arguments.
oddlyzen pushed a commit that referenced this pull request Apr 24, 2012
Fixes issues with Ruby 1.8.7, etc...
@oddlyzen oddlyzen merged commit ddfc112 into binarylogic:master Apr 24, 2012
@oddlyzen
Copy link

@johndouthat Thanks for the work you put into this! We're actually currently working on a fork for Rails 3 compatibility. If you'd like to help out (and get a first look), ping me and we will keep you in the loop during the upgrade process.

@johndouthat
Copy link
Contributor Author

Hi Mark,

Yeah, I'd love to help out and take a look.

Thank You,
John Douthat

Sent from my iPhone

On Apr 24, 2012, at 2:04 PM, Mark Coatesreply@reply.github.com wrote:

@johndouthat Thanks for the work you put into this! We're actually currently working on a fork for Rails 3 compatibility. If you'd like to help out (and get a first look), ping me and we will keep you in the loop during the upgrade process.


Reply to this email directly or view it on GitHub:
#156 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants