Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added public files and commented site_configuration so you can now in…
…stall clean
- Loading branch information
Valentino
authored and
Valentino
committed
Mar 24, 2011
1 parent
6ac8f96
commit e616df5
Showing
16 changed files
with
1,017 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Spree::Config.set(:homepage_groups => 'Slingbox,Satellite Radios,Boomboxes,Accessories,Internet Radios,Vehicle Installation') | ||
Spree::Config.set(:site_name => 'Rails Dog Radio') | ||
#Spree::Config.set(:homepage_groups => 'Slingbox,Satellite Radios,Boomboxes,Accessories,Internet Radios,Vehicle Installation') | ||
#Spree::Config.set(:site_name => 'Rails Dog Radio') | ||
|
||
Spree::ActiveShipping::Config.set(:origin_country => "US") | ||
Spree::ActiveShipping::Config.set(:origin_state => "MD") | ||
Spree::ActiveShipping::Config.set(:origin_city => "Chevy Chase") | ||
Spree::ActiveShipping::Config.set(:origin_zip => "20815") | ||
#Spree::ActiveShipping::Config.set(:origin_country => "US") | ||
#Spree::ActiveShipping::Config.set(:origin_state => "MD") | ||
#Spree::ActiveShipping::Config.set(:origin_city => "Chevy Chase") | ||
#Spree::ActiveShipping::Config.set(:origin_zip => "20815") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
db/migrate/20110314192118_remove_trailing_slashes_in_taxon_permalinks.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class RemoveTrailingSlashesInTaxonPermalinks < ActiveRecord::Migration | ||
def self.up | ||
Taxon.find_each(:conditions => {}) do |t| | ||
if t.permalink && t.permalink[-1..-1] == '/' | ||
t.update_attribute(:permalink, t.permalink[0...-1]) | ||
end | ||
end | ||
end | ||
|
||
def self.down | ||
Taxon.find_each(:conditions => {}) do |t| | ||
if t.permalink && t.permalink[-1..-1] != '/' | ||
t.update_attribute(:permalink, t.permalink + '/') | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# see last line where we create an admin if there is none, asking for email and password | ||
def prompt_for_admin_password | ||
password = ask('Password [spree123]: ', String) do |q| | ||
q.echo = false | ||
q.validate = /^(|.{5,40})$/ | ||
q.responses[:not_valid] = "Invalid password. Must be at least 5 characters long." | ||
q.whitespace = :strip | ||
end | ||
password = "spree123" if password.blank? | ||
password | ||
end | ||
|
||
def prompt_for_admin_email | ||
email = ask('Email [spree@example.com]: ', String) do |q| | ||
q.echo = true | ||
q.whitespace = :strip | ||
end | ||
email = "spree@example.com" if email.blank? | ||
end | ||
|
||
def create_admin_user | ||
if ENV['AUTO_ACCEPT'] | ||
password = "spree123" | ||
email = "spree@example.com" | ||
else | ||
require 'highline/import' | ||
puts "Create the admin user (press enter for defaults)." | ||
#name = prompt_for_admin_name unless name | ||
email = prompt_for_admin_email | ||
password = prompt_for_admin_password | ||
end | ||
attributes = { | ||
:password => password, | ||
:password_confirmation => password, | ||
:email => email, | ||
:login => email | ||
} | ||
|
||
load 'user.rb' | ||
|
||
if User.find_by_email(email) | ||
say "\nWARNING: There is already a user with the email: #{email}, so no account changes were made. If you wish to create an additional admin user, please run rake db:admin:create again with a different email.\n\n" | ||
else | ||
admin = User.create(attributes) | ||
# create an admin role and and assign the admin user to that role | ||
role = Role.find_or_create_by_name "admin" | ||
admin.roles << role | ||
admin.save | ||
end | ||
end | ||
|
||
create_admin_user if User.where("roles.name" => 'admin').includes(:roles).empty? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
module SpreeSite | ||
class Engine < Rails::Engine | ||
def self.activate | ||
|
||
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| | ||
Rails.configuration.cache_classes ? require(c) : load(c) | ||
end | ||
|
||
# Add your custom site logic here | ||
end | ||
|
||
def load_tasks | ||
end | ||
|
||
config.to_prepare &method(:activate).to_proc | ||
end | ||
end | ||
end |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.