quest_search 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ module QuestSearch
5
+ module Generators
6
+
7
+ class MigrationGenerator < Rails::Generators::NamedBase
8
+ desc "Generates migration file for the given model name"
9
+
10
+ include Rails::Generators::Migration
11
+
12
+ source_root File.expand_path('../../../templates', __FILE__)
13
+
14
+ def self.next_migration_number(dirname)
15
+ Time.now.strftime("%Y%m%d%H%M%S")
16
+ end
17
+
18
+ def create_migration
19
+ migration_template "add_quest_search_index.rb", "db/migrate/add_quest_search_index_to_#{class_name.underscore}.rb"
20
+ end
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,9 @@
1
+ class AddQuestSearchIndexTo<%= class_name.singularize %> < ActiveRecord::Migration
2
+ def up
3
+ add_column :<%= class_name.tableize %>, :quest_search_index, :text
4
+ end
5
+
6
+ def down
7
+ remove_column :<%= class_name.tableize %>, :quest_search_index
8
+ end
9
+ end
@@ -33,8 +33,6 @@ module QuestSearch
33
33
 
34
34
  results = self.where(conditions).order(@order)
35
35
 
36
- raise results.inspect
37
-
38
36
  if !sort
39
37
  results.sort do |a, b|
40
38
  b.points_for(query) <=> a.points_for(query)
@@ -1,3 +1,3 @@
1
1
  module QuestSearch
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quest_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -23,6 +23,8 @@ files:
23
23
  - Gemfile
24
24
  - README
25
25
  - Rakefile
26
+ - lib/generators/quest_search/migration/migration_generator.rb
27
+ - lib/generators/templates/add_quest_search_index.rb
26
28
  - lib/quest_search.rb
27
29
  - lib/quest_search/quest_search_on.rb
28
30
  - lib/quest_search/version.rb