blacklight 3.3.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.1
1
+ 3.3.2
@@ -23,7 +23,11 @@ class SavedSearchesController < ApplicationController
23
23
  # Only dereferences the user rather than removing the item in case it
24
24
  # is in the session[:history]
25
25
  def forget
26
- if current_user.search_ids.include?(params[:id].to_i) && Search.update(params[:id].to_i, :user_id => nil)
26
+ if current_user.search_ids.include?(params[:id].to_i)
27
+ search = Search.find(params[:id])
28
+ search.user_id = nil
29
+ search.save
30
+
27
31
  flash[:notice] = "Successfully removed that saved search."
28
32
  else
29
33
  flash[:error] = "Couldn't remove that saved search."
@@ -3,5 +3,6 @@ class Bookmark < ActiveRecord::Base
3
3
 
4
4
  belongs_to :user
5
5
  validates_presence_of :user_id, :scope=>:document_id
6
+ attr_accessible :id, :document_id, :title
6
7
 
7
8
  end
data/app/models/search.rb CHANGED
@@ -4,6 +4,7 @@ class Search < ActiveRecord::Base
4
4
  belongs_to :user
5
5
 
6
6
  serialize :query_params
7
+ attr_accessible :query_params
7
8
 
8
9
  # A Search instance is considered a saved search if it has a user_id.
9
10
  def saved?
data/blacklight.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.add_dependency "rsolr", "~> 1.0.6" # Library for interacting with rSolr.
28
28
  s.add_dependency "rsolr-ext", '~> 1.0.3' # extension to the above for some rails-ish behaviors - currently embedded in our solr document ojbect.
29
29
  s.add_dependency "kaminari" # the pagination (page 1,2,3, etc..) of our search results
30
- s.add_dependency "sass-rails", "~> 3.2.0"
30
+ s.add_dependency "sass-rails"
31
31
  s.add_development_dependency "jettywrapper", ">= 1.2.0"
32
32
  s.add_dependency "compass-rails", "~> 1.0.0"
33
33
  s.add_dependency "compass-susy-plugin", ">= 0.9.0"
@@ -18,7 +18,7 @@ describe Bookmark do
18
18
  end
19
19
 
20
20
  it "should be valid" do
21
- @bookmark.attributes = valid_bookmark_attributes
21
+ @bookmark.assign_attributes valid_bookmark_attributes, :without_protection => true
22
22
  @bookmark.should be_valid
23
23
  end
24
24
 
@@ -31,7 +31,7 @@ describe Bookmark do
31
31
  end
32
32
 
33
33
  it "should be valid after saving" do
34
- @bookmark.attributes = valid_bookmark_attributes
34
+ @bookmark.assign_attributes valid_bookmark_attributes, :without_protection => true
35
35
  @bookmark.save
36
36
  @bookmark.should be_valid
37
37
  end
@@ -20,7 +20,10 @@ describe Search do
20
20
 
21
21
  describe "saved?" do
22
22
  it "should be true when user_id is not NULL and greater than 0" do
23
- @search = Search.create(:user_id => 1)
23
+ @search = Search.new
24
+ @search.assign_attributes({:user_id => 1}, :without_protection => true)
25
+ @search.save
26
+
24
27
  @search.saved?.should be_true
25
28
  end
26
29
  it "should be false when user_id is NULL or less than 1" do
@@ -42,10 +45,19 @@ describe Search do
42
45
  it "should destroy searches with no user_id that are older than X days" do
43
46
  Search.destroy_all
44
47
  days_old = 7
45
- unsaved_search_today = Search.create(:user_id => nil, :created_at => Date.today)
46
- unsaved_search_past = Search.create(:user_id => nil, :created_at => Date.today - (days_old + 1).days)
47
- saved_search_today = Search.create(:user_id => 1, :created_at => Date.today)
48
- saved_search_past = Search.create(:user_id => 1, :created_at => (Date.today - (days_old + 1).days))
48
+ unsaved_search_today = Search.new
49
+ unsaved_search_today.assign_attributes({:user_id => nil, :created_at => Date.today}, :without_protection => true)
50
+ unsaved_search_today.save
51
+ unsaved_search_past = Search.new
52
+ unsaved_search_past.assign_attributes({:user_id => nil, :created_at => Date.today - (days_old + 1).days}, :without_protection => true)
53
+ unsaved_search_past.save
54
+ saved_search_today = Search.new
55
+ saved_search_today.assign_attributes({:user_id => 1, :created_at => Date.today}, :without_protection => true)
56
+ saved_search_today.save
57
+ saved_search_past = Search.new
58
+ saved_search_past.assign_attributes({:user_id => 1, :created_at => (Date.today - (days_old + 1).days)}, :without_protection => true)
59
+ saved_search_past.save
60
+
49
61
  lambda do
50
62
  Search.delete_old_searches(days_old)
51
63
  end.should change(Search, :count).by(-1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -16,11 +16,11 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2012-03-28 00:00:00.000000000 Z
19
+ date: 2012-04-17 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
23
- requirement: &261497360 !ruby/object:Gem::Requirement
23
+ requirement: !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
26
26
  - - ~>
@@ -28,10 +28,15 @@ dependencies:
28
28
  version: '3.1'
29
29
  type: :runtime
30
30
  prerelease: false
31
- version_requirements: *261497360
31
+ version_requirements: !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ~>
35
+ - !ruby/object:Gem::Version
36
+ version: '3.1'
32
37
  - !ruby/object:Gem::Dependency
33
38
  name: nokogiri
34
- requirement: &261496880 !ruby/object:Gem::Requirement
39
+ requirement: !ruby/object:Gem::Requirement
35
40
  none: false
36
41
  requirements:
37
42
  - - ~>
@@ -39,10 +44,15 @@ dependencies:
39
44
  version: '1.5'
40
45
  type: :runtime
41
46
  prerelease: false
42
- version_requirements: *261496880
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ~>
51
+ - !ruby/object:Gem::Version
52
+ version: '1.5'
43
53
  - !ruby/object:Gem::Dependency
44
54
  name: unicode
45
- requirement: &261496500 !ruby/object:Gem::Requirement
55
+ requirement: !ruby/object:Gem::Requirement
46
56
  none: false
47
57
  requirements:
48
58
  - - ! '>='
@@ -50,10 +60,15 @@ dependencies:
50
60
  version: '0'
51
61
  type: :runtime
52
62
  prerelease: false
53
- version_requirements: *261496500
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
54
69
  - !ruby/object:Gem::Dependency
55
70
  name: marc
56
- requirement: &261495920 !ruby/object:Gem::Requirement
71
+ requirement: !ruby/object:Gem::Requirement
57
72
  none: false
58
73
  requirements:
59
74
  - - ~>
@@ -61,10 +76,15 @@ dependencies:
61
76
  version: 0.4.3
62
77
  type: :runtime
63
78
  prerelease: false
64
- version_requirements: *261495920
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ~>
83
+ - !ruby/object:Gem::Version
84
+ version: 0.4.3
65
85
  - !ruby/object:Gem::Dependency
66
86
  name: rsolr
67
- requirement: &261495400 !ruby/object:Gem::Requirement
87
+ requirement: !ruby/object:Gem::Requirement
68
88
  none: false
69
89
  requirements:
70
90
  - - ~>
@@ -72,10 +92,15 @@ dependencies:
72
92
  version: 1.0.6
73
93
  type: :runtime
74
94
  prerelease: false
75
- version_requirements: *261495400
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ~>
99
+ - !ruby/object:Gem::Version
100
+ version: 1.0.6
76
101
  - !ruby/object:Gem::Dependency
77
102
  name: rsolr-ext
78
- requirement: &261494940 !ruby/object:Gem::Requirement
103
+ requirement: !ruby/object:Gem::Requirement
79
104
  none: false
80
105
  requirements:
81
106
  - - ~>
@@ -83,10 +108,15 @@ dependencies:
83
108
  version: 1.0.3
84
109
  type: :runtime
85
110
  prerelease: false
86
- version_requirements: *261494940
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ~>
115
+ - !ruby/object:Gem::Version
116
+ version: 1.0.3
87
117
  - !ruby/object:Gem::Dependency
88
118
  name: kaminari
89
- requirement: &261494560 !ruby/object:Gem::Requirement
119
+ requirement: !ruby/object:Gem::Requirement
90
120
  none: false
91
121
  requirements:
92
122
  - - ! '>='
@@ -94,21 +124,31 @@ dependencies:
94
124
  version: '0'
95
125
  type: :runtime
96
126
  prerelease: false
97
- version_requirements: *261494560
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
98
133
  - !ruby/object:Gem::Dependency
99
134
  name: sass-rails
100
- requirement: &261494020 !ruby/object:Gem::Requirement
135
+ requirement: !ruby/object:Gem::Requirement
101
136
  none: false
102
137
  requirements:
103
- - - ~>
138
+ - - ! '>='
104
139
  - !ruby/object:Gem::Version
105
- version: 3.2.0
140
+ version: '0'
106
141
  type: :runtime
107
142
  prerelease: false
108
- version_requirements: *261494020
143
+ version_requirements: !ruby/object:Gem::Requirement
144
+ none: false
145
+ requirements:
146
+ - - ! '>='
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
109
149
  - !ruby/object:Gem::Dependency
110
150
  name: jettywrapper
111
- requirement: &261493520 !ruby/object:Gem::Requirement
151
+ requirement: !ruby/object:Gem::Requirement
112
152
  none: false
113
153
  requirements:
114
154
  - - ! '>='
@@ -116,10 +156,15 @@ dependencies:
116
156
  version: 1.2.0
117
157
  type: :development
118
158
  prerelease: false
119
- version_requirements: *261493520
159
+ version_requirements: !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: 1.2.0
120
165
  - !ruby/object:Gem::Dependency
121
166
  name: compass-rails
122
- requirement: &261493060 !ruby/object:Gem::Requirement
167
+ requirement: !ruby/object:Gem::Requirement
123
168
  none: false
124
169
  requirements:
125
170
  - - ~>
@@ -127,10 +172,15 @@ dependencies:
127
172
  version: 1.0.0
128
173
  type: :runtime
129
174
  prerelease: false
130
- version_requirements: *261493060
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ none: false
177
+ requirements:
178
+ - - ~>
179
+ - !ruby/object:Gem::Version
180
+ version: 1.0.0
131
181
  - !ruby/object:Gem::Dependency
132
182
  name: compass-susy-plugin
133
- requirement: &261492600 !ruby/object:Gem::Requirement
183
+ requirement: !ruby/object:Gem::Requirement
134
184
  none: false
135
185
  requirements:
136
186
  - - ! '>='
@@ -138,7 +188,12 @@ dependencies:
138
188
  version: 0.9.0
139
189
  type: :runtime
140
190
  prerelease: false
141
- version_requirements: *261492600
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ none: false
193
+ requirements:
194
+ - - ! '>='
195
+ - !ruby/object:Gem::Version
196
+ version: 0.9.0
142
197
  description: Blacklight is a free and open source ruby-on-rails based discovery interface
143
198
  (a.k.a. “next-generation catalog”) especially optimized for heterogeneous collections.
144
199
  You can use it as a library catalog, as a front end for a digital repository, or
@@ -446,7 +501,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
446
501
  version: '0'
447
502
  segments:
448
503
  - 0
449
- hash: 4403143798290505525
504
+ hash: 1253427252595743180
450
505
  required_rubygems_version: !ruby/object:Gem::Requirement
451
506
  none: false
452
507
  requirements:
@@ -455,10 +510,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
455
510
  version: '0'
456
511
  segments:
457
512
  - 0
458
- hash: 4403143798290505525
513
+ hash: 1253427252595743180
459
514
  requirements: []
460
515
  rubyforge_project: blacklight
461
- rubygems_version: 1.8.15
516
+ rubygems_version: 1.8.21
462
517
  signing_key:
463
518
  specification_version: 3
464
519
  summary: A next-generation Library Catalag for Universities