enju_question 0.1.0.pre10 → 0.1.0.pre11
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.
- checksums.yaml +4 -4
- data/app/models/question.rb +0 -1
- data/app/views/questions/_list.html.erb +3 -3
- data/lib/enju_question/version.rb +1 -1
- data/lib/enju_question.rb +1 -0
- data/spec/controllers/answers_controller_spec.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/default/data/index/segments.gen +0 -0
- data/spec/dummy/solr/default/data/index/segments_128 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001365 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000153 → tlog.0000000000000001366} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001367 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000155 → tlog.0000000000000001368} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001369 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001370 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001371 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000157 → tlog.0000000000000001372} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001373 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001374 +0 -0
- metadata +38 -52
- data/spec/dummy/app/models/ability.rb +0 -44
- data/spec/dummy/app/views/page/403.html.erb +0 -9
- data/spec/dummy/app/views/page/403.mobile.erb +0 -5
- data/spec/dummy/app/views/page/403.xml.erb +0 -4
- data/spec/dummy/app/views/page/404.html.erb +0 -9
- data/spec/dummy/app/views/page/404.mobile.erb +0 -5
- data/spec/dummy/app/views/page/404.xml.erb +0 -4
- data/spec/dummy/solr/default/data/index/segments_4j +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000152 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000154 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000156 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000158 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000159 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000160 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000161 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ae5ecf6b5d7c744216cc19d1f8a08922e125dc7
|
4
|
+
data.tar.gz: 736fbeaa3c33d0209916045ba95e8d286cc7242a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 918e131260467456addb99f840bad845eb770c5924ee93f58acb9c16bc330fb108693e5d7b6099ed51589e9f65423000654c06f7eb6a9beea4b94cec02309572
|
7
|
+
data.tar.gz: fc493900650fb08c4f68587d3108198b4e078ce77def5771741a6e83b59bacf81d3ebf0cc89e1301c3c5168fc355431f253d01591e8a13541a0b0740cac8b449
|
data/app/models/question.rb
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
<th>ID</th>
|
25
25
|
<th><%= t('activerecord.models.question') -%></th>
|
26
26
|
<th></th>
|
27
|
-
<th
|
27
|
+
<th></th>
|
28
28
|
</tr>
|
29
29
|
|
30
30
|
<%- @questions.each_with_index do |question, i| -%>
|
@@ -51,10 +51,10 @@
|
|
51
51
|
</td>
|
52
52
|
<td>
|
53
53
|
<%- if can? :update, question -%>
|
54
|
-
<%= link_to
|
54
|
+
<%= link_to t('page.edit'), edit_question_path(question) -%>
|
55
55
|
<% end %>
|
56
56
|
<%- if can? :delete, question -%>
|
57
|
-
<%= link_to
|
57
|
+
<%= link_to t('page.destroy'), question, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
58
58
|
<%- end -%>
|
59
59
|
</td>
|
60
60
|
</tr>
|
data/lib/enju_question.rb
CHANGED
@@ -307,7 +307,7 @@ describe AnswersController do
|
|
307
307
|
describe "When logged in as User" do
|
308
308
|
login_fixture_user
|
309
309
|
|
310
|
-
it "should create answer
|
310
|
+
it "should create answer without user_id" do
|
311
311
|
post :create, :answer => {:question_id => 1, :body => 'hoge'}
|
312
312
|
response.should redirect_to answer_url(assigns(:answer))
|
313
313
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000153 → tlog.0000000000000001366}
RENAMED
Binary file
|
Binary file
|
data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000155 → tlog.0000000000000001368}
RENAMED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000157 → tlog.0000000000000001372}
RENAMED
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_question
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: enju_seed
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.1.
|
19
|
+
version: 0.1.1.pre9
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.1.
|
26
|
+
version: 0.1.1.pre9
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: simple_form
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rails_autolink
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: rspec-rails
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '2.99'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '2.99'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: factory_girl_rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.1.0.
|
131
|
+
version: 1.1.0.rc9
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.1.0.
|
138
|
+
version: 1.1.0.rc9
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: enju_ndl
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.1.0.
|
145
|
+
version: 0.1.0.pre31
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.1.0.
|
152
|
+
version: 0.1.0.pre31
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: sunspot_solr
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,7 +194,7 @@ dependencies:
|
|
194
194
|
version: '0'
|
195
195
|
description: Question and answer management for Next-L Enju
|
196
196
|
email:
|
197
|
-
-
|
197
|
+
- nabeta@fastmail.fm
|
198
198
|
executables: []
|
199
199
|
extensions: []
|
200
200
|
extra_rdoc_files: []
|
@@ -259,16 +259,9 @@ files:
|
|
259
259
|
- spec/dummy/app/assets/stylesheets/application.css
|
260
260
|
- spec/dummy/app/controllers/application_controller.rb
|
261
261
|
- spec/dummy/app/helpers/application_helper.rb
|
262
|
-
- spec/dummy/app/models/ability.rb
|
263
262
|
- spec/dummy/app/models/setting.rb
|
264
263
|
- spec/dummy/app/models/user.rb
|
265
264
|
- spec/dummy/app/views/layouts/application.html.erb
|
266
|
-
- spec/dummy/app/views/page/403.html.erb
|
267
|
-
- spec/dummy/app/views/page/403.mobile.erb
|
268
|
-
- spec/dummy/app/views/page/403.xml.erb
|
269
|
-
- spec/dummy/app/views/page/404.html.erb
|
270
|
-
- spec/dummy/app/views/page/404.mobile.erb
|
271
|
-
- spec/dummy/app/views/page/404.xml.erb
|
272
265
|
- spec/dummy/config.ru
|
273
266
|
- spec/dummy/config/application.rb
|
274
267
|
- spec/dummy/config/application.yml
|
@@ -386,17 +379,17 @@ files:
|
|
386
379
|
- spec/dummy/solr/conf/stopwords.txt
|
387
380
|
- spec/dummy/solr/conf/synonyms.txt
|
388
381
|
- spec/dummy/solr/default/data/index/segments.gen
|
389
|
-
- spec/dummy/solr/default/data/index/
|
390
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
391
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
392
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
393
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
394
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
395
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
396
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
397
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
398
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
399
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
382
|
+
- spec/dummy/solr/default/data/index/segments_128
|
383
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001365
|
384
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001366
|
385
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001367
|
386
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001368
|
387
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001369
|
388
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001370
|
389
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001371
|
390
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001372
|
391
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001373
|
392
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001374
|
400
393
|
- spec/dummy/solr/development/data/index/segments.gen
|
401
394
|
- spec/dummy/solr/development/data/index/segments_1
|
402
395
|
- spec/dummy/solr/solr.xml
|
@@ -438,7 +431,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
438
431
|
version: 1.3.1
|
439
432
|
requirements: []
|
440
433
|
rubyforge_project:
|
441
|
-
rubygems_version: 2.2.
|
434
|
+
rubygems_version: 2.2.2
|
442
435
|
signing_key:
|
443
436
|
specification_version: 4
|
444
437
|
summary: enju_queestion plugin
|
@@ -452,16 +445,9 @@ test_files:
|
|
452
445
|
- spec/dummy/app/assets/stylesheets/application.css
|
453
446
|
- spec/dummy/app/controllers/application_controller.rb
|
454
447
|
- spec/dummy/app/helpers/application_helper.rb
|
455
|
-
- spec/dummy/app/models/ability.rb
|
456
448
|
- spec/dummy/app/models/setting.rb
|
457
449
|
- spec/dummy/app/models/user.rb
|
458
450
|
- spec/dummy/app/views/layouts/application.html.erb
|
459
|
-
- spec/dummy/app/views/page/403.html.erb
|
460
|
-
- spec/dummy/app/views/page/403.mobile.erb
|
461
|
-
- spec/dummy/app/views/page/403.xml.erb
|
462
|
-
- spec/dummy/app/views/page/404.html.erb
|
463
|
-
- spec/dummy/app/views/page/404.mobile.erb
|
464
|
-
- spec/dummy/app/views/page/404.xml.erb
|
465
451
|
- spec/dummy/config/application.rb
|
466
452
|
- spec/dummy/config/application.yml
|
467
453
|
- spec/dummy/config/boot.rb
|
@@ -580,17 +566,17 @@ test_files:
|
|
580
566
|
- spec/dummy/solr/conf/stopwords.txt
|
581
567
|
- spec/dummy/solr/conf/synonyms.txt
|
582
568
|
- spec/dummy/solr/default/data/index/segments.gen
|
583
|
-
- spec/dummy/solr/default/data/index/
|
584
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
585
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
586
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
587
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
588
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
589
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
590
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
591
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
592
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
593
|
-
- spec/dummy/solr/default/data/tlog/tlog.
|
569
|
+
- spec/dummy/solr/default/data/index/segments_128
|
570
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001365
|
571
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001366
|
572
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001367
|
573
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001368
|
574
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001369
|
575
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001370
|
576
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001371
|
577
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001372
|
578
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001373
|
579
|
+
- spec/dummy/solr/default/data/tlog/tlog.0000000000000001374
|
594
580
|
- spec/dummy/solr/development/data/index/segments.gen
|
595
581
|
- spec/dummy/solr/development/data/index/segments_1
|
596
582
|
- spec/dummy/solr/solr.xml
|
@@ -1,44 +0,0 @@
|
|
1
|
-
#module EnjuQuestion
|
2
|
-
class Ability
|
3
|
-
include CanCan::Ability
|
4
|
-
|
5
|
-
def initialize(user, ip_address = nil)
|
6
|
-
case user.try(:role).try(:name)
|
7
|
-
when 'Administrator'
|
8
|
-
can :manage, Answer
|
9
|
-
can :manage, Question
|
10
|
-
when 'Librarian'
|
11
|
-
can :manage, Answer
|
12
|
-
can :manage, Question
|
13
|
-
when 'User'
|
14
|
-
can [:index, :create], Answer
|
15
|
-
can :show, Answer do |answer|
|
16
|
-
if answer.user == user
|
17
|
-
true
|
18
|
-
elsif answer.question.shared
|
19
|
-
true
|
20
|
-
end
|
21
|
-
end
|
22
|
-
can [:update, :destroy, :delete], Answer do |answer|
|
23
|
-
answer.user == user
|
24
|
-
end
|
25
|
-
can [:index, :create], Question
|
26
|
-
can [:update, :destroy, :delete], Question do |question|
|
27
|
-
question.user == user
|
28
|
-
end
|
29
|
-
can :show, Question do |question|
|
30
|
-
question.user == user or question.shared
|
31
|
-
end
|
32
|
-
else
|
33
|
-
can :index, Answer
|
34
|
-
can :show, Answer do |answer|
|
35
|
-
answer.question.shared
|
36
|
-
end
|
37
|
-
can :index, Question
|
38
|
-
can :show, Question do |question|
|
39
|
-
question.shared
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
#end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|