groonga-client-rails 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +6 -0
- data/lib/groonga/client/rails/version.rb +1 -1
- data/lib/groonga/client/searcher/schema.rb +4 -0
- data/lib/groonga/client/searcher/schema_synchronizer.rb +8 -1
- data/test/apps/rails4-mongoid/Gemfile.lock +1 -1
- data/test/apps/rails4-mongoid/app/controllers/posts_controller.rb +7 -1
- data/test/apps/rails4-mongoid/app/models/post.rb +6 -0
- data/test/apps/rails4-mongoid/app/searchers/posts_searcher.rb +5 -0
- data/test/apps/rails4-mongoid/app/views/posts/_form.html.erb +4 -0
- data/test/apps/rails4-mongoid/app/views/posts/index.json.jbuilder +1 -1
- data/test/apps/rails4-mongoid/app/views/posts/show.html.erb +6 -0
- data/test/apps/rails4-mongoid/app/views/posts/show.json.jbuilder +1 -1
- data/test/apps/rails4-mongoid/log/development.log +1576 -0
- data/test/apps/rails4-mongoid/log/test.log +1121 -0
- data/test/apps/rails4-mongoid/test/searchers/posts_searcher_test.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c2734632b846ae915755b89870df52681baed3
|
4
|
+
data.tar.gz: 943dda80d5cd297b3fb3256ba7d0a0d6f7a5018a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f4ee6862d905d8fcf67da653873ec3d2998eeb9236c46b3d75db3522a118b9654ebaf9537fe918b6e1e98c238e3b8ab290ceffeca7cc2dea45b8d5dfc31ce97
|
7
|
+
data.tar.gz: 22a8543082e087569e262ddb96f477e59f9605dfe48bc86a7aafb81732e453bf17e079acc92f23dba5d82f9cb12952d61f424fe4c1b25df8d78ab603379780e4
|
data/doc/text/news.md
CHANGED
@@ -50,9 +50,16 @@ module Groonga
|
|
50
50
|
def sync_column(column, current_column)
|
51
51
|
if current_column.nil?
|
52
52
|
Client.open do |client|
|
53
|
+
flags = []
|
54
|
+
if column.vector?
|
55
|
+
flags << "COLUMN_VECTOR"
|
56
|
+
else
|
57
|
+
flags << "COLUMN_SCALAR"
|
58
|
+
end
|
53
59
|
client.column_create(:table => @schema.table,
|
54
60
|
:name => column.name,
|
55
|
-
:type => column.type
|
61
|
+
:type => column.type,
|
62
|
+
:flags => flags.join("|"))
|
56
63
|
end
|
57
64
|
end
|
58
65
|
|
@@ -15,10 +15,12 @@ class PostsController < ApplicationController
|
|
15
15
|
# GET /posts/new
|
16
16
|
def new
|
17
17
|
@post = Post.new
|
18
|
+
@tags = tags
|
18
19
|
end
|
19
20
|
|
20
21
|
# GET /posts/1/edit
|
21
22
|
def edit
|
23
|
+
@tags = tags
|
22
24
|
end
|
23
25
|
|
24
26
|
# POST /posts
|
@@ -69,6 +71,10 @@ class PostsController < ApplicationController
|
|
69
71
|
|
70
72
|
# Never trust parameters from the scary internet, only allow the white list through.
|
71
73
|
def post_params
|
72
|
-
params.require(:post).permit(:title, :body)
|
74
|
+
params.require(:post).permit(:title, :body, tags: [])
|
75
|
+
end
|
76
|
+
|
77
|
+
def tags
|
78
|
+
["tag1", "tag2", "tag3"]
|
73
79
|
end
|
74
80
|
end
|
@@ -3,10 +3,16 @@ class Post
|
|
3
3
|
include Mongoid::Timestamps
|
4
4
|
field :title, type: String
|
5
5
|
field :body, type: String
|
6
|
+
field :tags, type: Array
|
6
7
|
|
7
8
|
PostsSearcher.source(self).title = :title
|
8
9
|
PostsSearcher.source(self).body = lambda do |model|
|
9
10
|
model.body.gsub(/<.*?>/, "")
|
10
11
|
end
|
12
|
+
PostsSearcher.source(self).tags = true
|
11
13
|
PostsSearcher.source(self).updated_at = true
|
14
|
+
|
15
|
+
def tags=(value)
|
16
|
+
super(value.reject(&:blank?))
|
17
|
+
end
|
12
18
|
end
|
@@ -1 +1 @@
|
|
1
|
-
json.extract! @post, :id, :title, :body, :created_at, :updated_at
|
1
|
+
json.extract! @post, :id, :title, :body, :tags, :created_at, :updated_at
|