refinerycms-generators 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/gemspec.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- version = '1.0.0'
2
+ version = '1.0.1'
3
3
  raise "Could not get version so gemspec can not be built" if version.nil?
4
4
  files = Dir.glob("**/*").flatten.reject do |file|
5
5
  file =~ /\.gem$/
@@ -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 %>.find(:all, :order => "position ASC")
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.find_by_link_url("/<%= plural_name %>")
27
+ @page = Page.where(:link_url => "/<%= plural_name %>").first
28
28
  end
29
29
 
30
30
  end
@@ -1,5 +1,5 @@
1
- User.find(:all).each do |user|
2
- if user.plugins.find_by_name('<%= class_name.pluralize.underscore.downcase %>').nil?
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
@@ -1,4 +1,4 @@
1
- require 'refinery'
1
+ require 'refinerycms-base'
2
2
 
3
3
  module Refinery
4
4
  module <%= class_name.pluralize %><%= 'Engine' if plural_name == singular_name %>
@@ -1,4 +1,4 @@
1
- require 'refinery'
1
+ require 'refinerycms-base'
2
2
  require 'pathname'
3
3
 
4
4
  module Refinery
@@ -1,4 +1,4 @@
1
- require 'refinery'
1
+ require 'refinerycms-base'
2
2
  require File.expand_path('../refinery/generators', __FILE__)
3
3
 
4
4
  module Refinery
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.0}
4
- s.date = %q{2011-03-11}
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.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-11 00:00:00 +13:00
13
+ date: 2011-03-24 00:00:00 +13:00
14
14
  default_executable:
15
15
  dependencies: []
16
16