refinerycms-core 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/refinery/admin.js.erb +2 -2
- data/app/views/refinery/_javascripts.html.erb +1 -0
- data/lib/generators/refinery/engine/templates/config/routes.rb +1 -1
- data/lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb +2 -5
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/plural_name_controller.rb +4 -4
- data/lib/generators/refinery/form/templates/config/routes.rb +1 -1
- data/lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb +2 -5
- data/lib/refinery/core/engine.rb +10 -0
- data/lib/refinery/plugin.rb +8 -1
- data/lib/refinery/version.rb +1 -1
- data/license.md +1 -1
- metadata +4 -4
@@ -6,13 +6,10 @@ module Refinery
|
|
6
6
|
|
7
7
|
engine_name :refinery_<%= extension_plural_name %>
|
8
8
|
|
9
|
-
initializer "register refinerycms_<%= plural_name %> plugin" do
|
9
|
+
initializer "register refinerycms_<%= plural_name %> plugin" do
|
10
10
|
Refinery::Plugin.register do |plugin|
|
11
11
|
plugin.name = "<%= plural_name %>"
|
12
|
-
plugin.url = {
|
13
|
-
:controller => 'refinery/<%= namespacing.underscore %>/admin/<%= plural_name %>',
|
14
|
-
:action => 'index'
|
15
|
-
}
|
12
|
+
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.<%= namespacing.underscore %>_admin_<%= plural_name %>_path }
|
16
13
|
plugin.pathname = root
|
17
14
|
plugin.activity = {
|
18
15
|
:class_name => :'refinery/<%= namespacing.underscore %>/<%= singular_name %>'<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
|
@@ -22,15 +22,15 @@ module Refinery
|
|
22
22
|
if @<%= singular_name %>.save
|
23
23
|
begin
|
24
24
|
Mailer.notification(@<%= singular_name %>, request).deliver
|
25
|
-
rescue
|
26
|
-
logger.warn "There was an error delivering
|
25
|
+
rescue => e
|
26
|
+
logger.warn "There was an error delivering the <%= singular_name %> notification.\n#{e.message}\n"
|
27
27
|
end<% if @includes_spam %> if @<%= singular_name %>.ham?<% end %>
|
28
28
|
|
29
29
|
if <%= class_name %>.column_names.map(&:to_s).include?('email')
|
30
30
|
begin
|
31
31
|
Mailer.confirmation(@<%= singular_name %>, request).deliver
|
32
|
-
rescue
|
33
|
-
logger.warn "There was an error delivering
|
32
|
+
rescue => e
|
33
|
+
logger.warn "There was an error delivering the <%= singular_name %> confirmation:\n#{e.message}\n"
|
34
34
|
end<% if @includes_spam %> if @<%= singular_name %>.ham?<% end %>
|
35
35
|
else
|
36
36
|
logger.warn "Please add an 'email' field to <%= class_name %> if you wish to send confirmation emails when forms are submitted."
|
@@ -6,13 +6,10 @@ module Refinery
|
|
6
6
|
|
7
7
|
engine_name :refinery_<%= extension_plural_name %>
|
8
8
|
|
9
|
-
initializer "register refinerycms_<%= plural_name %> plugin" do
|
9
|
+
initializer "register refinerycms_<%= plural_name %> plugin" do
|
10
10
|
Refinery::Plugin.register do |plugin|
|
11
11
|
plugin.name = "<%= plural_name %>"
|
12
|
-
plugin.url = {
|
13
|
-
:controller => 'refinery/<%= namespacing.underscore %>/admin/<%= plural_name %>',
|
14
|
-
:action => 'index'
|
15
|
-
}
|
12
|
+
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.<%= namespacing.underscore %>_admin_<%= plural_name %>_path }
|
16
13
|
plugin.pathname = root
|
17
14
|
plugin.activity = {
|
18
15
|
:class_name => :'refinery/<%= namespacing.underscore %>/<%= singular_name %>'<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
|
data/lib/refinery/core/engine.rb
CHANGED
@@ -138,6 +138,16 @@ module Refinery
|
|
138
138
|
config.after_initialize do
|
139
139
|
Refinery.register_extension(Refinery::Core)
|
140
140
|
end
|
141
|
+
|
142
|
+
# We need to reload the routes here due to how Refinery sets them up
|
143
|
+
# The different facets of Refinery (dashboard, pages, etc.) append/prepend routes to Core
|
144
|
+
# *after* Core has been loaded.
|
145
|
+
#
|
146
|
+
# So we wait until after initialization is complete to do one final reload
|
147
|
+
# This then makes the appended/prepended routes available to the application.
|
148
|
+
config.after_initialize do
|
149
|
+
Rails.application.routes_reloader.reload!
|
150
|
+
end
|
141
151
|
end
|
142
152
|
end
|
143
153
|
end
|
data/lib/refinery/plugin.rb
CHANGED
@@ -66,7 +66,14 @@ module Refinery
|
|
66
66
|
else
|
67
67
|
{ :controller => "refinery/admin/#{name}" }
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
|
+
if @url.is_a?(Hash)
|
71
|
+
{:only_path => true}.merge(@url)
|
72
|
+
elsif @url.respond_to?(:call)
|
73
|
+
@url.call
|
74
|
+
else
|
75
|
+
@url
|
76
|
+
end
|
70
77
|
end
|
71
78
|
|
72
79
|
# Make this protected, so that only Plugin.register can use it.
|
data/lib/refinery/version.rb
CHANGED
data/license.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2005-
|
3
|
+
Copyright (c) 2005-2012 [Resolve Digital](http://www.resolvedigital.com)
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 1
|
10
|
+
version: 2.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Philip Arndt
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2012-03-
|
21
|
+
date: 2012-03-06 00:00:00 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
prerelease: false
|