enju_question 0.1.0.pre12 → 0.1.0.pre13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/answer.rb +1 -1
  3. data/app/models/question.rb +5 -5
  4. data/app/views/questions/_crd.html.erb +4 -4
  5. data/app/views/questions/_solved_facet.html.erb +1 -1
  6. data/app/views/questions/index.rss.builder +5 -5
  7. data/lib/enju_question/version.rb +1 -1
  8. data/spec/cassette_library/Question/test_should_get_crd_search.yml +486 -406
  9. data/spec/cassette_library/QuestionsController/GET_index/When_not_logged_in/should_get_index_with_query.yml +524 -444
  10. data/spec/cassette_library/QuestionsController/GET_index/When_not_logged_in/should_render_crd_xml_template.yml +524 -444
  11. data/spec/controllers/questions_controller_spec.rb +2 -2
  12. data/spec/dummy/config/boot.rb +2 -2
  13. data/spec/dummy/config/initializers/friendly_id.rb +90 -0
  14. data/spec/dummy/db/migrate/133_create_agent_merges.rb +15 -0
  15. data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +13 -0
  16. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +1 -1
  17. data/spec/dummy/db/schema.rb +444 -428
  18. data/spec/dummy/db/test.sqlite3 +0 -0
  19. data/spec/dummy/solr/default/data/index/segments.gen +0 -0
  20. data/spec/dummy/solr/default/data/index/segments_1km +0 -0
  21. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002027 +0 -0
  22. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002028 +0 -0
  23. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002029 +0 -0
  24. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002030 +0 -0
  25. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002031 +0 -0
  26. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002032 +0 -0
  27. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002033 +0 -0
  28. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002034 +0 -0
  29. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002035 +0 -0
  30. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002036 +0 -0
  31. data/spec/fixtures/users.yml +1 -1
  32. data/spec/spec_helper.rb +1 -1
  33. data/spec/views/questions/index.rss.builder_spec.rb +22 -0
  34. metadata +43 -35
  35. data/spec/dummy/solr/default/data/index/segments_1c8 +0 -0
  36. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001725 +0 -0
  37. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001726 +0 -0
  38. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001727 +0 -0
  39. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001728 +0 -0
  40. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001729 +0 -0
  41. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001730 +0 -0
  42. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001731 +0 -0
  43. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001732 +0 -0
  44. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001733 +0 -0
  45. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001734 +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9bfa05a0add606a0ac41ce620c5c8d90aeb16db
4
- data.tar.gz: c06de63d0fe30b4e3c3dbba3fa07c2f2c0793b42
3
+ metadata.gz: e6ecc1065776585a67c92f3f44b8b16ab961eb0f
4
+ data.tar.gz: d70e615307eaeb402b0f6d02f80ccf45a55de491
5
5
  SHA512:
6
- metadata.gz: c85ceeb84b0750bd5378471143e6120a38145e50d46c4dcb101929ac25568263b591c22f2690cb22096e89232930ccfc7b542c4d3b12d1d005718e0f62a16089
7
- data.tar.gz: 34229ed11ecaa06ee192bee85ec2ba8f57df80d4b2c50282edd137c032a36366f190c73330bae3cf6e735cef6f6dfbaf2e3ea6ae764691f9b819149ee2574814
6
+ metadata.gz: 2fcef2da47cd00ea941882ec3a383726af4e93cd12f6722896b632436e01d0faef6911c2d7179e0527b13a42cde138d4a4722142be15ae870ab27dcfa4ba0c4c
7
+ data.tar.gz: d160eb04967edc55516b8735ed7bd64d2a7f02b6564126575a7ddb207c45987ad5aacc1a7b8e2be0b1ae09a4daa9e57d08106256bb4741717d297f3fb1481c5e
data/app/models/answer.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class Answer < ActiveRecord::Base
3
3
  attr_accessible :question_id, :body, :item_identifier_list, :url_list
4
- default_scope order: 'answers.id ASC'
4
+ default_scope { order('answers.id ASC') }
5
5
  #scope :public_answers, where(:shared => true)
6
6
  #scope :private_answers, where(:shared => false)
7
7
  belongs_to :user, validate: true
@@ -1,11 +1,11 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class Question < ActiveRecord::Base
3
3
  attr_accessible :body, :shared, :solved, :note
4
- default_scope order: 'id DESC'
5
- scope :public_questions, where(:shared => true)
6
- scope :private_questions, where(:shared => false)
7
- scope :solved, where(:solved => true)
8
- scope :unsolved, where(:solved => false)
4
+ default_scope { order('id DESC') }
5
+ scope :public_questions, -> {where(shared: true)}
6
+ scope :private_questions, -> {where(shared: false)}
7
+ scope :solved, -> {where(solved: true)}
8
+ scope :unsolved, -> {where(solved: false)}
9
9
  belongs_to :user, validate: true
10
10
  has_many :answers, dependent: :destroy
11
11
 
@@ -1,14 +1,14 @@
1
1
  <div id="crd">
2
2
  <%- if @crd_results -%>
3
- <h4><%= link_to t('question.crd'), "http://crd.ndl.go.jp/" -%></h4>
4
- <p><%= t('question.number_of_search_results', :count => @crd_results.total_count) -%><br />
3
+ <h4><%= link_to t('question.crd'), "https://crd.ndl.go.jp/" -%></h4>
4
+ <p><%= t('question.number_of_search_results', count: @crd_results.total_count) -%><br />
5
5
  <ul>
6
6
  <%- @crd_results.each do |result| -%>
7
7
  <li><%= link_to h(truncate(result[:question])), result[:url] -%></li>
8
8
  <%- end -%>
9
9
  </ul>
10
- <%= paginate(@crd_results, param_name: :crd_page, remote: true, :window => 1) -%>
10
+ <%= paginate(@crd_results, param_name: :crd_page, remote: true, window: 1) -%>
11
11
  <%- else -%>
12
- <p><%= link_to t('question.you_can_search_crd'), "http://crd.ndl.go.jp/" -%></p>
12
+ <p><%= link_to t('question.you_can_search_crd'), "https://crd.ndl.go.jp/" -%></p>
13
13
  <%- end -%>
14
14
  </div>
@@ -10,6 +10,6 @@
10
10
  </li>
11
11
  <%- end -%>
12
12
  <%- if @solved -%>
13
- <li><%= link_to t('page.remove_this_facet'), url_for(params.merge(:solved => nil, page: nil, view: nil, only_path: true)) -%></li>
13
+ <li><%= link_to t('page.remove_this_facet'), url_for(params.merge(solved: nil, page: nil, view: nil, only_path: true)) -%></li>
14
14
  <%- end -%>
15
15
  </ul>
@@ -4,8 +4,8 @@ xml.rss('version' => "2.0",
4
4
  'xmlns:atom' => "http://www.w3.org/2005/Atom"){
5
5
  xml.channel{
6
6
  if @user
7
- xml.title t('question.user_question', :login_name => @user.username)
8
- xml.link user_questions_url(@user)
7
+ xml.title t('question.user_question', login_name: @user.username)
8
+ xml.link questions_url(user_id: @user.username)
9
9
  else
10
10
  xml.title t('question.library_group_question', library_group_name: @library_group.display_name.localize)
11
11
  xml.link questions_url
@@ -14,13 +14,13 @@ xml.rss('version' => "2.0",
14
14
  xml.language @locale.to_s
15
15
  xml.ttl "60"
16
16
  if @user
17
- xml.tag! "atom:link", rel: 'self', href: user_questions_url(@user, format: :rss)
18
- xml.tag! "atom:link", rel: 'alternate', href: user_questions_url(@user)
17
+ xml.tag! "atom:link", rel: 'self', href: questions_url(user_id: @user.username, format: :rss)
18
+ xml.tag! "atom:link", rel: 'alternate', href: questions_url(user_id: @user.username)
19
19
  else
20
20
  xml.tag! "atom:link", rel: 'self', href: questions_url(format: :rss)
21
21
  xml.tag! "atom:link", rel: 'alternate', href: questions_url
22
22
  end
23
- #xml.tag! "atom:link", rel: 'search', :type => 'application/opensearchdescription+xml', href: "http://#{request.host_with_port}/page/opensearch"
23
+ #xml.tag! "atom:link", rel: 'search', :type => 'application/opensearchdescription+xml', href: page_opensearch_url(format: :xml)
24
24
  unless params[:query].blank?
25
25
  xml.tag! "opensearch:totalResults", @count[:query_result]
26
26
  xml.tag! "opensearch:startIndex", @questions.offset + 1
@@ -1,3 +1,3 @@
1
1
  module EnjuQuestion
2
- VERSION = "0.1.0.pre12"
2
+ VERSION = "0.1.0.pre13"
3
3
  end