Permalink
Browse files

Can now generate its own migration and seed.

  • Loading branch information...
1 parent 35f476e commit 7f4365f9bd15c5a43f783c7a5cf7c76274180f50 @parndt parndt committed Nov 30, 2010
@@ -0,0 +1,32 @@
+class CreateInquiries < ActiveRecord::Migration
+ def self.up
+ create_table ::Inquiry.table_name, :force => true do |t|
+ t.string "name"
+ t.string "email"
+ t.string "phone"
+ t.text "message"
+ t.integer "position"
+ t.boolean "open", :default => true
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "spam", :default => false
+ end
+
+ # todo: remove at 1.0
+ create_table ::InquirySetting.table_name, :force => true do |t|
+ t.string "name"
+ t.text "value"
+ t.boolean "destroyable"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index ::Inquiry.table_name, :id
+ end
+
+ def self.down
+ remove_table ::Inquiry.table_name
+ # todo: remove at 1.0
+ remove_table ::InquirySetting.table_name
+ end
+end
View
@@ -0,0 +1,44 @@
+contact_us_page = Page.create({
+ :title => "Contact",
+ :link_url => "/contact",
+ :menu_match => "^/(inquiries|contact).*$",
+ :deletable => false,
+ :position => (page_position += 1)
+})
+contact_us_page.parts.create({
+ :title => "Body",
+ :body => "<p>Get in touch with us. Just use the form below and we'll get back to you as soon as we can.</p>",
+ :position => 0
+})
+contact_us_page.parts.create({
+ :title => "Side Body",
+ :body => "<p>163 Evergreen Terrace<br/>Happyville<br/>USA.<br/>Phone: 1-800 CALLUSNOW</p>",
+ :position => 1
+})
+contact_us_page_position = -1
+
+thank_you_page = contact_us_page.children.create({
+ :title => "Thank You",
+ :link_url => "/contact/thank_you",
+ :menu_match => "^/(inquiries|contact)/thank_you$",
+ :show_in_menu => false,
+ :deletable => false,
+ :position => (contact_us_page_position += 1)
+})
+thank_you_page.parts.create({
+ :title => "Body",
+ :body => "<p>We've received your inquiry and will get back to you with a response shortly.</p><p><a href='/'>Return to the home page</a></p>",
+ :position => 0
+})
+
+privacy_policy_page = contact_us_page.children.create({
+ :title => "Privacy Policy",
+ :deletable => true,
+ :show_in_menu => false,
+ :position => (contact_us_page_position += 1)
+})
+privacy_policy_page.parts.create({
+ :title => "Body",
+ :body => "<p>We respect your privacy. We do not market, rent or sell our email list to any outside parties.</p><p>We need your e-mail address so that we can ensure that the people using our forms are bona fide. It also allows us to send you e-mail newsletters and other communications, if you opt-in. Your postal address is required in order to send you information and pricing, if you request it.</p><p>Please call us at 123 456 7890 if you have any questions or concerns.</p>",
+ :position => 0
+})
View
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-version = '0.9.9.5'
+version = '0.9.9.6'
raise "Could not get version so gemspec can not be built" if version.nil?
files = Dir.glob("**/*").flatten.reject do |file|
file =~ /\.gem$/
@@ -0,0 +1,6 @@
+class RefinerycmsInquiries < Refinery::Generators::EngineInstaller
+
+ source_root File.expand_path('../../', __FILE__)
+ engine_name "refinery_inquiries"
+
+end
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-inquiries}
- s.version = %q{0.9.9.5}
- s.date = %q{2010-11-19}
+ s.version = %q{0.9.9.6}
+ s.date = %q{2010-11-30}
s.summary = %q{Inquiry handling functionality for the Refinery CMS project.}
s.description = %q{Inquiry handling functionality extracted from Refinery CMS to allow you to have a contact form and manage inquiries in the Refinery backend.}
s.homepage = %q{http://refinerycms.com}
@@ -50,6 +50,7 @@ Gem::Specification.new do |s|
'config/locales/fr.yml',
'config/locales/it.yml',
'config/locales/lolcat.yml',
+ 'config/locales/lt.yml',
'config/locales/lv.yml',
'config/locales/nb.yml',
'config/locales/nl.yml',
@@ -59,6 +60,11 @@ Gem::Specification.new do |s|
'config/locales/sv.yml',
'config/locales/zh-CN.yml',
'config/routes.rb',
+ 'db',
+ 'db/migrate',
+ 'db/migrate/create_inquiries.rb',
+ 'db/seeds',
+ 'db/seeds/inquiries.rb',
'features',
'features/create_inquiries.feature',
'features/manage_inquiries.feature',
@@ -69,6 +75,8 @@ Gem::Specification.new do |s|
'features/support/paths.rb',
'lib',
'lib/gemspec.rb',
+ 'lib/generators',
+ 'lib/generators/refinerycms_inquiries_generator.rb',
'lib/inquiries.rb',
'lib/refinerycms-inquiries.rb',
'license.md',

0 comments on commit 7f4365f

Please sign in to comment.