wheels 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/pages_controller.rb +2 -2
- data/app/helpers/application_helper.rb +0 -52
- data/app/models/sitemap.rb +5 -1
- data/app/views/discussions/show.html.haml +1 -1
- data/app/views/forums/show.html.haml +1 -1
- data/lib/wheels/wheels_engine.rb +0 -1
- data/spec/spec_helper.rb +27 -0
- data/wheels.gemspec +5 -2
- metadata +6 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.17
|
@@ -2,7 +2,7 @@ class PagesController < InheritedResources::Base
|
|
2
2
|
respond_to :js, :html
|
3
3
|
ajax_loading
|
4
4
|
before_filter :authenticate_user!, :except=>[:show]
|
5
|
-
before_filter :authorize_resource
|
5
|
+
before_filter :authorize_resource!, :except=>[:index, :show]
|
6
6
|
|
7
7
|
has_scope :tagged_with, :as => :tag
|
8
8
|
|
@@ -20,7 +20,7 @@ class PagesController < InheritedResources::Base
|
|
20
20
|
@page = @sitemap.try(:resource)
|
21
21
|
end
|
22
22
|
if @page
|
23
|
-
@child_pages =
|
23
|
+
@child_pages = Sitemap.accessible_by(current_ability).where(:parent_id=>@sitemap.id)
|
24
24
|
|
25
25
|
if can_access_resources?
|
26
26
|
respond_with @page, @sitemap, @child_pages, @attachments
|
@@ -9,58 +9,6 @@ module ApplicationHelper
|
|
9
9
|
content_tag(:li, content_tag(:a, content_tag(:span, name, :class=>name.underscore), :href=>url), :class=>_class)
|
10
10
|
end
|
11
11
|
|
12
|
-
# def your_basic_form(object, *options)
|
13
|
-
# if object.methods.include? :form_fields then options = object.form_fields.merge(options)
|
14
|
-
# options[:submit] ||= ""
|
15
|
-
# concat(capture do
|
16
|
-
# content_tag('div',
|
17
|
-
# form_for(object, remote=>options[:remote]|| false) {|f|
|
18
|
-
# if object.errors.any?
|
19
|
-
# content_tag('div',
|
20
|
-
# content_tag('h2', "#{pluralize(resource.errors.count, "error")} prohibited this change:") +
|
21
|
-
# content_tag('ul',
|
22
|
-
# resource.errors.full_messages.map{|msg| content_tag('li', msg)}.join('\n')
|
23
|
-
# )
|
24
|
-
# , :id=>'errorExplanation' )
|
25
|
-
# end
|
26
|
-
# options.except(:remote).each do |key, value|
|
27
|
-
# form_field(key, value, f)
|
28
|
-
# end
|
29
|
-
# },
|
30
|
-
# :class=>'form')
|
31
|
-
# end)
|
32
|
-
# end
|
33
|
-
|
34
|
-
# def form_field(key, value, form_helper)
|
35
|
-
# capture do
|
36
|
-
# if value.is_a?(Hash) || (value.is_a? Symbol && value.to_s.ends_with('_attributes')) # This means it's a field group.
|
37
|
-
# content_tag('div',
|
38
|
-
# content_tag('div', key.to_s, :class=>'fieldGroupTitle') +
|
39
|
-
# value.is_a?(Hash) ?
|
40
|
-
# value.map{|t,u| form_field(t,u)}.join('\n') :
|
41
|
-
# basic_fields_for(key, value, form_helper),
|
42
|
-
# :class=>'fieldGroup')
|
43
|
-
# else
|
44
|
-
# content_tag('div',
|
45
|
-
# content_tag('div',
|
46
|
-
# form_helper.label(key),
|
47
|
-
# :class=>'fieldName') +
|
48
|
-
# content_tag('div',
|
49
|
-
# form_helper.send(value, key),
|
50
|
-
# :class=>'fieldValue'),
|
51
|
-
# :class=>'field')
|
52
|
-
# end
|
53
|
-
# end
|
54
|
-
# end
|
55
|
-
|
56
|
-
# def basic_fields_for(key, value, form_helper)
|
57
|
-
# capture do
|
58
|
-
# form_helper.fields_for value.to_s.gsub(/_attributes/, '').to_sym{|f|
|
59
|
-
|
60
|
-
# }
|
61
|
-
# end
|
62
|
-
# end
|
63
|
-
|
64
12
|
def sidebar_content(&block)
|
65
13
|
@sidebar = true
|
66
14
|
content_for(:sidebar) do
|
data/app/models/sitemap.rb
CHANGED
@@ -55,10 +55,14 @@ class Sitemap < ActiveRecord::Base
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# Callbacks
|
58
|
-
def reload_root
|
58
|
+
def self.reload_root
|
59
59
|
Sitemap.instance_variable_set('@_root', nil)
|
60
60
|
end
|
61
61
|
|
62
|
+
def reload_root
|
63
|
+
Sitemap.reload_root
|
64
|
+
end
|
65
|
+
|
62
66
|
def on_before_destroy
|
63
67
|
resource.destroy if resource && resource.sitemaps.size==1
|
64
68
|
end
|
@@ -8,7 +8,7 @@
|
|
8
8
|
Posted By #{message.author.email} on #{message.updated_at}
|
9
9
|
.box_content!= message.message
|
10
10
|
|
11
|
-
=
|
11
|
+
= sidebar_content do
|
12
12
|
%ul
|
13
13
|
- if can? :create, Discussion, :forum_id=>@forum.id
|
14
14
|
%li= link_to "Reply to this discussion", new_forum_discussion_forum_message_path(@forum, @discussion)
|
@@ -12,7 +12,7 @@
|
|
12
12
|
- if can? :manage, discussion
|
13
13
|
= link_to "Manage", edit_forum_discussion_path(@forum, discussion)
|
14
14
|
|
15
|
-
=
|
15
|
+
= sidebar_content do
|
16
16
|
- if can? :create, Discussion, :forum_id=>@forum.id
|
17
17
|
%li= link_to "New topic in this forum", new_forum_discussion_path(@forum)
|
18
18
|
- if can? :manage, @forum
|
data/lib/wheels/wheels_engine.rb
CHANGED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
|
6
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
7
|
+
# in spec/support/ and its subdirectories.
|
8
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
# == Mock Framework
|
12
|
+
#
|
13
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
14
|
+
#
|
15
|
+
# config.mock_with :mocha
|
16
|
+
# config.mock_with :flexmock
|
17
|
+
# config.mock_with :rr
|
18
|
+
config.mock_with :rspec
|
19
|
+
|
20
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
21
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
22
|
+
|
23
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
24
|
+
# examples within a transaction, remove the following line or assign false
|
25
|
+
# instead of true.
|
26
|
+
config.use_transactional_fixtures = true
|
27
|
+
end
|
data/wheels.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{wheels}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.17"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tyler Gannon"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-23}
|
13
13
|
s.description = %q{Call rails generate wheels.}
|
14
14
|
s.email = %q{tgannon@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -306,6 +306,9 @@ Gem::Specification.new do |s|
|
|
306
306
|
s.require_paths = ["lib"]
|
307
307
|
s.rubygems_version = %q{1.3.7}
|
308
308
|
s.summary = %q{Generator builds a web site with blog, user profile, etc.}
|
309
|
+
s.test_files = [
|
310
|
+
"spec/spec_helper.rb"
|
311
|
+
]
|
309
312
|
|
310
313
|
if s.respond_to? :specification_version then
|
311
314
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 17
|
9
|
+
version: 0.1.17
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Tyler Gannon
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-23 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -323,6 +323,7 @@ files:
|
|
323
323
|
- lib/wheels/user.rb
|
324
324
|
- lib/wheels/wheels_engine.rb
|
325
325
|
- wheels.gemspec
|
326
|
+
- spec/spec_helper.rb
|
326
327
|
has_rdoc: true
|
327
328
|
homepage: http://github.com/tylergannon/wheels
|
328
329
|
licenses: []
|
@@ -355,5 +356,5 @@ rubygems_version: 1.3.7
|
|
355
356
|
signing_key:
|
356
357
|
specification_version: 3
|
357
358
|
summary: Generator builds a web site with blog, user profile, etc.
|
358
|
-
test_files:
|
359
|
-
|
359
|
+
test_files:
|
360
|
+
- spec/spec_helper.rb
|