crowdblog 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a1154b421fa6b447415de0edee998f803dd99d42
4
+ data.tar.gz: 4b59be962b63c204af1148b6fc9a7f4364ab2fd2
5
+ SHA512:
6
+ metadata.gz: ca077a59daeee2a4d50b0467144614cd86362eafcde2a90b6d694720be8a98a4a13641a7cfcb146aa381021c6ff68cdb867eb964a9c4836757db41ffd6bcee87
7
+ data.tar.gz: 0d5db35a1e483fcbf94ab9bdcf0558714187b71f1e3436aafad62adeaefd54b66970b19d69398143498b45890fc946c4e9219440658c3b64d74f5ecaea0b88e9
@@ -7,6 +7,8 @@ module Crowdblog
7
7
  def create
8
8
  namespace = '_as_publisher' if current_user.is_publisher?
9
9
  @post.send "#{params[:transition]}#{namespace}"
10
+ status = @post.status_change_records.build(user: current_user, state: params[:transition])
11
+ status.save
10
12
  respond_with @post, location: admin_post_url(@post)
11
13
  end
12
14
 
@@ -3,6 +3,7 @@ module Crowdblog
3
3
  belongs_to :author, :class_name => Crowdblog.author_user_class_name
4
4
  belongs_to :publisher, :class_name => Crowdblog.publisher_user_class_name
5
5
  has_many :assets
6
+ has_many :status_change_records
6
7
 
7
8
  delegate :name, to: :author, prefix: true, allow_nil: true
8
9
  delegate :email, to: :author, prefix: true, allow_nil: true
@@ -0,0 +1,6 @@
1
+ module Crowdblog
2
+ class StatusChangeRecord < ActiveRecord::Base
3
+ belongs_to :post
4
+ belongs_to :user
5
+ end
6
+ end
@@ -1,4 +1,4 @@
1
- = cache post do
1
+ = cache [:admin, post] do
2
2
  = content_tag_for :tr, post, :"data-post-id" => post.id, :"data-state" => post.state, :"data-ready-for-review" => post.ready_for_review do
3
3
  td= post.title
4
4
  td= post.author_email
data/crowdblog.gemspec CHANGED
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.add_development_dependency 'database_cleaner'
32
32
  s.add_development_dependency 'fuubar'
33
33
  s.add_development_dependency 'rspec-rails'
34
+ s.add_development_dependency 'selenium-webdriver'
34
35
  s.add_development_dependency 'simplecov'
35
36
  s.add_development_dependency 'simplecov-rcov-text'
36
37
  s.add_development_dependency 'sqlite3'
@@ -0,0 +1,11 @@
1
+ class CreateCrowdblogStatusChangeRecords < ActiveRecord::Migration
2
+ def change
3
+ create_table :crowdblog_status_change_records do |t|
4
+ t.belongs_to :user
5
+ t.belongs_to :post
6
+ t.string :state
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -72,6 +72,8 @@ shared_examples_for "a crowdblog", :type => :feature do
72
72
  page.should have_css '.publish-btn.btn-success'
73
73
  page.should have_css '.review.active'
74
74
  post.reload.state.should eq 'published'
75
+ post.status_change_records.last.state.should == 'publish'
76
+ post.status_change_records.last.user.should == Crowdblog::User.last
75
77
  end
76
78
  end
77
79
 
@@ -87,6 +89,8 @@ shared_examples_for "a crowdblog", :type => :feature do
87
89
  page.should have_css '.publish-btn.btn-danger'
88
90
  page.should have_css '.draft.active'
89
91
  post.reload.state.should eq 'drafted'
92
+ post.status_change_records.last.state.should == 'draft'
93
+ post.status_change_records.last.user.should == Crowdblog::User.last
90
94
  end
91
95
  end
92
96
 
@@ -100,6 +104,8 @@ shared_examples_for "a crowdblog", :type => :feature do
100
104
 
101
105
  page.should have_css '.review.active'
102
106
  post.reload.state.should eq 'reviewed'
107
+ post.status_change_records.last.state.should == 'review'
108
+ post.status_change_records.last.user.should == Crowdblog::User.last
103
109
  end
104
110
  end
105
111
 
@@ -112,6 +118,8 @@ shared_examples_for "a crowdblog", :type => :feature do
112
118
 
113
119
  page.should have_css '.finish.active'
114
120
  post.reload.state.should eq 'finished'
121
+ post.status_change_records.last.state.should == 'finish'
122
+ post.status_change_records.last.user.should == Crowdblog::User.last
115
123
  end
116
124
  end
117
125
  end
@@ -1,3 +1,3 @@
1
1
  module Crowdblog
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
@@ -11,13 +11,13 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20121016063750) do
14
+ ActiveRecord::Schema.define(:version => 20140501164642) do
15
15
 
16
16
  create_table "crowdblog_assets", :force => true do |t|
17
17
  t.integer "post_id"
18
18
  t.string "attachment"
19
- t.datetime "created_at", :null => false
20
- t.datetime "updated_at", :null => false
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
21
21
  end
22
22
 
23
23
  create_table "crowdblog_posts", :force => true do |t|
@@ -30,11 +30,19 @@ ActiveRecord::Schema.define(:version => 20121016063750) do
30
30
  t.integer "publisher_id"
31
31
  t.boolean "ready_for_review"
32
32
  t.datetime "marked_for_review_at"
33
- t.datetime "created_at", :null => false
34
- t.datetime "updated_at", :null => false
33
+ t.datetime "created_at"
34
+ t.datetime "updated_at"
35
+ end
36
+
37
+ create_table "crowdblog_status_change_records", :force => true do |t|
38
+ t.integer "user_id"
39
+ t.integer "post_id"
40
+ t.string "state"
41
+ t.datetime "created_at", :null => false
42
+ t.datetime "updated_at", :null => false
35
43
  end
36
44
 
37
- create_table "crowdblog_users", :force => true do |t|
45
+ create_table "users", :force => true do |t|
38
46
  t.string "email"
39
47
  t.string "name"
40
48
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crowdblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
5
- prerelease:
4
+ version: 0.3.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Crowd Interactive
@@ -13,262 +12,244 @@ authors:
13
12
  autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
- date: 2013-03-05 00:00:00.000000000 Z
15
+ date: 2014-05-01 00:00:00.000000000 Z
17
16
  dependencies:
18
17
  - !ruby/object:Gem::Dependency
19
18
  name: rails
20
19
  requirement: !ruby/object:Gem::Requirement
21
- none: false
22
20
  requirements:
23
- - - ~>
21
+ - - "~>"
24
22
  - !ruby/object:Gem::Version
25
23
  version: '3.2'
26
24
  type: :runtime
27
25
  prerelease: false
28
26
  version_requirements: !ruby/object:Gem::Requirement
29
- none: false
30
27
  requirements:
31
- - - ~>
28
+ - - "~>"
32
29
  - !ruby/object:Gem::Version
33
30
  version: '3.2'
34
31
  - !ruby/object:Gem::Dependency
35
32
  name: carrierwave
36
33
  requirement: !ruby/object:Gem::Requirement
37
- none: false
38
34
  requirements:
39
- - - ! '>='
35
+ - - ">="
40
36
  - !ruby/object:Gem::Version
41
37
  version: '0'
42
38
  type: :runtime
43
39
  prerelease: false
44
40
  version_requirements: !ruby/object:Gem::Requirement
45
- none: false
46
41
  requirements:
47
- - - ! '>='
42
+ - - ">="
48
43
  - !ruby/object:Gem::Version
49
44
  version: '0'
50
45
  - !ruby/object:Gem::Dependency
51
46
  name: gravtastic
52
47
  requirement: !ruby/object:Gem::Requirement
53
- none: false
54
48
  requirements:
55
- - - ! '>='
49
+ - - ">="
56
50
  - !ruby/object:Gem::Version
57
51
  version: '0'
58
52
  type: :runtime
59
53
  prerelease: false
60
54
  version_requirements: !ruby/object:Gem::Requirement
61
- none: false
62
55
  requirements:
63
- - - ! '>='
56
+ - - ">="
64
57
  - !ruby/object:Gem::Version
65
58
  version: '0'
66
59
  - !ruby/object:Gem::Dependency
67
60
  name: jquery-rails
68
61
  requirement: !ruby/object:Gem::Requirement
69
- none: false
70
62
  requirements:
71
- - - ! '>='
63
+ - - ">="
72
64
  - !ruby/object:Gem::Version
73
65
  version: '0'
74
66
  type: :runtime
75
67
  prerelease: false
76
68
  version_requirements: !ruby/object:Gem::Requirement
77
- none: false
78
69
  requirements:
79
- - - ! '>='
70
+ - - ">="
80
71
  - !ruby/object:Gem::Version
81
72
  version: '0'
82
73
  - !ruby/object:Gem::Dependency
83
74
  name: jbuilder
84
75
  requirement: !ruby/object:Gem::Requirement
85
- none: false
86
76
  requirements:
87
- - - ! '>='
77
+ - - ">="
88
78
  - !ruby/object:Gem::Version
89
79
  version: '0'
90
80
  type: :runtime
91
81
  prerelease: false
92
82
  version_requirements: !ruby/object:Gem::Requirement
93
- none: false
94
83
  requirements:
95
- - - ! '>='
84
+ - - ">="
96
85
  - !ruby/object:Gem::Version
97
86
  version: '0'
98
87
  - !ruby/object:Gem::Dependency
99
88
  name: redcarpet
100
89
  requirement: !ruby/object:Gem::Requirement
101
- none: false
102
90
  requirements:
103
- - - ! '>='
91
+ - - ">="
104
92
  - !ruby/object:Gem::Version
105
93
  version: '0'
106
94
  type: :runtime
107
95
  prerelease: false
108
96
  version_requirements: !ruby/object:Gem::Requirement
109
- none: false
110
97
  requirements:
111
- - - ! '>='
98
+ - - ">="
112
99
  - !ruby/object:Gem::Version
113
100
  version: '0'
114
101
  - !ruby/object:Gem::Dependency
115
102
  name: slim
116
103
  requirement: !ruby/object:Gem::Requirement
117
- none: false
118
104
  requirements:
119
- - - ! '>='
105
+ - - ">="
120
106
  - !ruby/object:Gem::Version
121
107
  version: '0'
122
108
  type: :runtime
123
109
  prerelease: false
124
110
  version_requirements: !ruby/object:Gem::Requirement
125
- none: false
126
111
  requirements:
127
- - - ! '>='
112
+ - - ">="
128
113
  - !ruby/object:Gem::Version
129
114
  version: '0'
130
115
  - !ruby/object:Gem::Dependency
131
116
  name: state_machine
132
117
  requirement: !ruby/object:Gem::Requirement
133
- none: false
134
118
  requirements:
135
- - - ! '>='
119
+ - - ">="
136
120
  - !ruby/object:Gem::Version
137
121
  version: '0'
138
122
  type: :runtime
139
123
  prerelease: false
140
124
  version_requirements: !ruby/object:Gem::Requirement
141
- none: false
142
125
  requirements:
143
- - - ! '>='
126
+ - - ">="
144
127
  - !ruby/object:Gem::Version
145
128
  version: '0'
146
129
  - !ruby/object:Gem::Dependency
147
130
  name: strong_parameters
148
131
  requirement: !ruby/object:Gem::Requirement
149
- none: false
150
132
  requirements:
151
- - - ! '>='
133
+ - - ">="
152
134
  - !ruby/object:Gem::Version
153
135
  version: '0'
154
136
  type: :runtime
155
137
  prerelease: false
156
138
  version_requirements: !ruby/object:Gem::Requirement
157
- none: false
158
139
  requirements:
159
- - - ! '>='
140
+ - - ">="
160
141
  - !ruby/object:Gem::Version
161
142
  version: '0'
162
143
  - !ruby/object:Gem::Dependency
163
144
  name: capybara-webkit
164
145
  requirement: !ruby/object:Gem::Requirement
165
- none: false
166
146
  requirements:
167
- - - ! '>='
147
+ - - ">="
168
148
  - !ruby/object:Gem::Version
169
149
  version: '0'
170
150
  type: :development
171
151
  prerelease: false
172
152
  version_requirements: !ruby/object:Gem::Requirement
173
- none: false
174
153
  requirements:
175
- - - ! '>='
154
+ - - ">="
176
155
  - !ruby/object:Gem::Version
177
156
  version: '0'
178
157
  - !ruby/object:Gem::Dependency
179
158
  name: database_cleaner
180
159
  requirement: !ruby/object:Gem::Requirement
181
- none: false
182
160
  requirements:
183
- - - ! '>='
161
+ - - ">="
184
162
  - !ruby/object:Gem::Version
185
163
  version: '0'
186
164
  type: :development
187
165
  prerelease: false
188
166
  version_requirements: !ruby/object:Gem::Requirement
189
- none: false
190
167
  requirements:
191
- - - ! '>='
168
+ - - ">="
192
169
  - !ruby/object:Gem::Version
193
170
  version: '0'
194
171
  - !ruby/object:Gem::Dependency
195
172
  name: fuubar
196
173
  requirement: !ruby/object:Gem::Requirement
197
- none: false
198
174
  requirements:
199
- - - ! '>='
175
+ - - ">="
200
176
  - !ruby/object:Gem::Version
201
177
  version: '0'
202
178
  type: :development
203
179
  prerelease: false
204
180
  version_requirements: !ruby/object:Gem::Requirement
205
- none: false
206
181
  requirements:
207
- - - ! '>='
182
+ - - ">="
208
183
  - !ruby/object:Gem::Version
209
184
  version: '0'
210
185
  - !ruby/object:Gem::Dependency
211
186
  name: rspec-rails
212
187
  requirement: !ruby/object:Gem::Requirement
213
- none: false
214
188
  requirements:
215
- - - ! '>='
189
+ - - ">="
216
190
  - !ruby/object:Gem::Version
217
191
  version: '0'
218
192
  type: :development
219
193
  prerelease: false
220
194
  version_requirements: !ruby/object:Gem::Requirement
221
- none: false
222
195
  requirements:
223
- - - ! '>='
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ - !ruby/object:Gem::Dependency
200
+ name: selenium-webdriver
201
+ requirement: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ type: :development
207
+ prerelease: false
208
+ version_requirements: !ruby/object:Gem::Requirement
209
+ requirements:
210
+ - - ">="
224
211
  - !ruby/object:Gem::Version
225
212
  version: '0'
226
213
  - !ruby/object:Gem::Dependency
227
214
  name: simplecov
228
215
  requirement: !ruby/object:Gem::Requirement
229
- none: false
230
216
  requirements:
231
- - - ! '>='
217
+ - - ">="
232
218
  - !ruby/object:Gem::Version
233
219
  version: '0'
234
220
  type: :development
235
221
  prerelease: false
236
222
  version_requirements: !ruby/object:Gem::Requirement
237
- none: false
238
223
  requirements:
239
- - - ! '>='
224
+ - - ">="
240
225
  - !ruby/object:Gem::Version
241
226
  version: '0'
242
227
  - !ruby/object:Gem::Dependency
243
228
  name: simplecov-rcov-text
244
229
  requirement: !ruby/object:Gem::Requirement
245
- none: false
246
230
  requirements:
247
- - - ! '>='
231
+ - - ">="
248
232
  - !ruby/object:Gem::Version
249
233
  version: '0'
250
234
  type: :development
251
235
  prerelease: false
252
236
  version_requirements: !ruby/object:Gem::Requirement
253
- none: false
254
237
  requirements:
255
- - - ! '>='
238
+ - - ">="
256
239
  - !ruby/object:Gem::Version
257
240
  version: '0'
258
241
  - !ruby/object:Gem::Dependency
259
242
  name: sqlite3
260
243
  requirement: !ruby/object:Gem::Requirement
261
- none: false
262
244
  requirements:
263
- - - ! '>='
245
+ - - ">="
264
246
  - !ruby/object:Gem::Version
265
247
  version: '0'
266
248
  type: :development
267
249
  prerelease: false
268
250
  version_requirements: !ruby/object:Gem::Requirement
269
- none: false
270
251
  requirements:
271
- - - ! '>='
252
+ - - ">="
272
253
  - !ruby/object:Gem::Version
273
254
  version: '0'
274
255
  description: This mountable engine has the basic functionality to manage Posts
@@ -282,12 +263,12 @@ executables: []
282
263
  extensions: []
283
264
  extra_rdoc_files: []
284
265
  files:
285
- - .autotest
286
- - .gitignore
287
- - .rspec
288
- - .rvmrc
289
- - .simplecov
290
- - .travis.yml
266
+ - ".autotest"
267
+ - ".gitignore"
268
+ - ".rspec"
269
+ - ".rvmrc"
270
+ - ".simplecov"
271
+ - ".travis.yml"
291
272
  - Gemfile
292
273
  - MIT-LICENSE
293
274
  - README.md
@@ -310,6 +291,7 @@ files:
310
291
  - app/helpers/crowdblog/application_helper.rb
311
292
  - app/models/crowdblog/asset.rb
312
293
  - app/models/crowdblog/post.rb
294
+ - app/models/crowdblog/status_change_record.rb
313
295
  - app/models/crowdblog/user.rb
314
296
  - app/presenters/crowdblog/post_presenter.rb
315
297
  - app/uploaders/attachment_uploader.rb
@@ -335,6 +317,7 @@ files:
335
317
  - db/migrate/20120217213920_create_crowdblog_posts.rb
336
318
  - db/migrate/20120219071614_create_crowdblog_assets.rb
337
319
  - db/migrate/20121016063750_create_crowdblog_users.rb
320
+ - db/migrate/20140501164642_create_crowdblog_status_change_records.rb
338
321
  - lib/crowdblog.rb
339
322
  - lib/crowdblog/devise/failure_app.rb
340
323
  - lib/crowdblog/engine.rb
@@ -401,34 +384,27 @@ files:
401
384
  - vendor/assets/javascripts/uploader/jquery.html5uploader.js
402
385
  homepage: http://github.com/crowdint/crowdblog
403
386
  licenses: []
387
+ metadata: {}
404
388
  post_install_message:
405
389
  rdoc_options: []
406
390
  require_paths:
407
391
  - lib
408
392
  - app
409
393
  required_ruby_version: !ruby/object:Gem::Requirement
410
- none: false
411
394
  requirements:
412
- - - ! '>='
395
+ - - ">="
413
396
  - !ruby/object:Gem::Version
414
397
  version: '0'
415
- segments:
416
- - 0
417
- hash: 2681320744990779676
418
398
  required_rubygems_version: !ruby/object:Gem::Requirement
419
- none: false
420
399
  requirements:
421
- - - ! '>='
400
+ - - ">="
422
401
  - !ruby/object:Gem::Version
423
402
  version: '0'
424
- segments:
425
- - 0
426
- hash: 2681320744990779676
427
403
  requirements: []
428
404
  rubyforge_project:
429
- rubygems_version: 1.8.23
405
+ rubygems_version: 2.2.0
430
406
  signing_key:
431
- specification_version: 3
407
+ specification_version: 4
432
408
  summary: CrowdBlog base functionality and backend
433
409
  test_files:
434
410
  - spec/dummy/.rvmrc