governor 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -41,7 +41,7 @@ generator will add an initializer to your app:
41
41
 
42
42
  rails generate governor:configure
43
43
 
44
- Here's a snippet from the initializer:
44
+ Here's a snippet from the generated initializer:
45
45
 
46
46
  # How to reference the author of an article
47
47
  Governor.author = Proc.new do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
@@ -15,10 +15,12 @@ class Governor::ArticlesController < ApplicationController
15
15
  # GET /articles
16
16
  # GET /articles.xml
17
17
  def index
18
+ # if plugins modify default scope, show everything if user is logged in
19
+ collection = governor_logged_in? ? model_class.unscoped : model_class
18
20
  set_resources(if model_class.respond_to?(:paginate)
19
- model_class.paginate :page => params[:page], :order => 'created_at DESC'
21
+ collection.paginate :page => params[:page], :order => 'created_at DESC'
20
22
  else
21
- model_class.all :order => 'created_at DESC'
23
+ collection.all :order => 'created_at DESC'
22
24
  end)
23
25
  respond_with resources
24
26
  end
data/governor.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{governor}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Liam Morley"]
12
- s.date = %q{2011-05-14}
12
+ s.date = %q{2011-05-15}
13
13
  s.description = %q{Because Blogojevich would be too tough to remember. It's a pluggable blogging system for Rails 3.}
14
14
  s.email = %q{liam@carpeliam.com}
15
15
  s.extra_rdoc_files = [
@@ -120,6 +120,7 @@ Gem::Specification.new do |s|
120
120
  "spec/rails_app/vendor/plugins/.gitkeep",
121
121
  "spec/spec_helper.rb",
122
122
  "spec/views/governor/articles/index.html.erb_spec.rb",
123
+ "spec/views/governor/articles/new.html.erb_spec.rb",
123
124
  "spec/views/layouts/application.html.erb_spec.rb"
124
125
  ]
125
126
  s.homepage = %q{http://carpeliam.github.com/governor}
@@ -163,6 +164,7 @@ Gem::Specification.new do |s|
163
164
  "spec/rails_app/spec/factories.rb",
164
165
  "spec/spec_helper.rb",
165
166
  "spec/views/governor/articles/index.html.erb_spec.rb",
167
+ "spec/views/governor/articles/new.html.erb_spec.rb",
166
168
  "spec/views/layouts/application.html.erb_spec.rb"
167
169
  ]
168
170
 
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ class ActionView::Base
4
+ include Governor::Controllers::Helpers
5
+
6
+ def params
7
+ {:governor_mapping => :articles}
8
+ end
9
+ end
10
+
11
+ module Governor
12
+ describe "governor/articles/new.html.erb" do
13
+ include Devise::TestHelpers
14
+
15
+ before(:each) do
16
+ @user = Factory(:user)
17
+ @article = ::Article.new
18
+ assign(:article, @article)
19
+ controller.stubs(:action_name).returns('new')
20
+ sign_in @user
21
+ render
22
+ end
23
+
24
+ it "shows the form" do
25
+ rendered.should =~ /New article/
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: governor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 4
10
- version: 0.5.4
9
+ - 5
10
+ version: 0.5.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Liam Morley
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-14 00:00:00 -04:00
18
+ date: 2011-05-15 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -322,6 +322,7 @@ files:
322
322
  - spec/rails_app/vendor/plugins/.gitkeep
323
323
  - spec/spec_helper.rb
324
324
  - spec/views/governor/articles/index.html.erb_spec.rb
325
+ - spec/views/governor/articles/new.html.erb_spec.rb
325
326
  - spec/views/layouts/application.html.erb_spec.rb
326
327
  has_rdoc: true
327
328
  homepage: http://carpeliam.github.com/governor
@@ -393,4 +394,5 @@ test_files:
393
394
  - spec/rails_app/spec/factories.rb
394
395
  - spec/spec_helper.rb
395
396
  - spec/views/governor/articles/index.html.erb_spec.rb
397
+ - spec/views/governor/articles/new.html.erb_spec.rb
396
398
  - spec/views/layouts/application.html.erb_spec.rb