Skip to content

Commit

Permalink
Renamed project to SearchCop
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Vetter committed Jul 29, 2014
1 parent 3647bed commit a62a743
Show file tree
Hide file tree
Showing 41 changed files with 500 additions and 379 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -3,8 +3,8 @@ addons:
postgresql: "9.3"

before_script:
- mysql -e 'create database attr_searchable;'
- psql -c 'create database attr_searchable;' -U postgres
- mysql -e 'create database search_cop;'
- psql -c 'create database search_cop;' -U postgres

rvm:
- 1.9.3
Expand Down
6 changes: 3 additions & 3 deletions Appraisals
@@ -1,14 +1,14 @@
appraise "3.2" do
gem "activerecord", "~> 3.2.18"
gem "attr_searchable", :path => "../"
gem "search_cop", :path => "../"
end

appraise "4.0" do
gem "activerecord", "~> 4.0.0"
gem "attr_searchable", :path => "../"
gem "search_cop", :path => "../"
end

appraise "4.1" do
gem "activerecord", "~> 4.1.0.beta"
gem "attr_searchable", :path => "../"
gem "search_cop", :path => "../"
end
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in attr_searchable.gemspec
# Specify your gem's dependencies in search_cop.gemspec
gemspec

platforms :jruby do
Expand Down
55 changes: 55 additions & 0 deletions MIGRATION.md
@@ -0,0 +1,55 @@

# General

Before:

```ruby
class Book < ActiveRecord::Base
include AttrSearchable

attr_searchable :title, :description
attr_searchable :comment => ["comments.title", "comments.message"]
attr_searchable :user => ["users.username", "users_books.username"]

attr_searchable_options :title, :type => :fulltext, :default => true

attr_searchable_alias :users_books => :user
end
```

After:

```ruby
class Book < ActiveRecord::Base
include SearchCop

search_scope :search do
attributes :title, :description
attributes :comment => ["comments.title", "comments.message"]
attributes :user => ["users.username", "users_books.username"]

options :title, :type => :fulltext, :default => true

aliases :users_books => :user
end
end
```ruby
# Reflection
Before:
```
Book.searchable_attributes
Book.default_searchable_attributes
Book.searchable_aliases
```

After:

```
Book.search_reflection(:search).attributes
Book.search_reflection(:search).default_attributes
Book.search_reflection(:search).aliases
```

0 comments on commit a62a743

Please sign in to comment.