refinerycms-generators 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gemspec.rb +1 -1
- data/lib/generators/refinery_engine/templates/app/controllers/plural_name_controller.rb +2 -2
- data/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb +2 -2
- data/lib/generators/refinery_engine/templates/lib/refinerycms-plural_name.rb +1 -1
- data/lib/refinery/generators.rb +1 -1
- data/lib/refinerycms-generators.rb +1 -1
- data/readme.md +7 -0
- data/refinerycms-generators.gemspec +2 -2
- metadata +2 -2
data/lib/gemspec.rb
CHANGED
@@ -20,11 +20,11 @@ class <%= class_name.pluralize %>Controller < ApplicationController
|
|
20
20
|
protected
|
21
21
|
|
22
22
|
def find_all_<%= plural_name %>
|
23
|
-
@<%= "all_" if plural_name == singular_name %><%= plural_name %> = <%= class_name %>.
|
23
|
+
@<%= "all_" if plural_name == singular_name %><%= plural_name %> = <%= class_name %>.order('position ASC')
|
24
24
|
end
|
25
25
|
|
26
26
|
def find_page
|
27
|
-
@page = Page.
|
27
|
+
@page = Page.where(:link_url => "/<%= plural_name %>").first
|
28
28
|
end
|
29
29
|
|
30
30
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
User.
|
2
|
-
if user.plugins.
|
1
|
+
User.all.each do |user|
|
2
|
+
if user.plugins.where(:name => '<%= class_name.pluralize.underscore.downcase %>').blank?
|
3
3
|
user.plugins.create(:name => '<%= class_name.pluralize.underscore.downcase %>',
|
4
4
|
:position => (user.plugins.maximum(:position) || -1) +1)
|
5
5
|
end
|
data/lib/refinery/generators.rb
CHANGED
data/readme.md
CHANGED
@@ -68,3 +68,10 @@ Now you have a fully managed products section in Refinery, nice.
|
|
68
68
|
If you want to modify your generated engine you need to understand the basic structure of how they work.
|
69
69
|
|
70
70
|
See: [The Structure of an Engine](http://github.com/resolve/refinerycms/blob/master/vendor/refinerycms/core/engines.md)
|
71
|
+
|
72
|
+
## Nesting Engines: Generating Engines Inside Engines
|
73
|
+
|
74
|
+
Say you have an existing Products engine and you wanted to add a Categories engine inside it so the projects can be sorted in categories.
|
75
|
+
|
76
|
+
rails generate refinery_engine category title:string product:engine
|
77
|
+
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{refinerycms-generators}
|
3
|
-
s.version = %q{1.0.
|
4
|
-
s.date = %q{2011-03-
|
3
|
+
s.version = %q{1.0.1}
|
4
|
+
s.date = %q{2011-03-24}
|
5
5
|
s.summary = %q{Core generators for the Refinery CMS project.}
|
6
6
|
s.description = %q{Core generators for Refinery CMS including refinery_engine.}
|
7
7
|
s.homepage = %q{http://refinerycms.com}
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: refinerycms-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Resolve Digital
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-24 00:00:00 +13:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|