Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

no more vlad, using delegate, do not store database in git

no sqlite

no alternate connection, doesn't work
  • Loading branch information...
commit 7eb1bd126f49ffc88a8a8eadc7143a5fa4647696 1 parent fedf539
@docunext authored
View
4 Capfile
@@ -1,8 +1,8 @@
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Uncomment if you are using Rails' asset pipeline
-# load 'deploy/assets'
+load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
-load 'config/deploy' # remove this line to skip loading any of the default tasks
+load 'config/deploy' # remove this line to skip loading any of the default tasks
View
6 Gemfile
@@ -2,12 +2,14 @@ source :gemcutter
gem 'rails'
-gem 'sqlite3'
+gem 'mysql'
+#gem 'sqlite3'
gem 'haml'
gem 'sass'
gem 'nested_set'
gem 'state_machine'
gem 'inherited_resources'
+gem 'prawn'
group :assets do
gem 'sass-rails'
@@ -21,7 +23,7 @@ gem 'css3buttons'
gem "will_paginate"
group :development do
-# gem 'memcached'
+ gem 'memcached'
gem 'web-app-theme'
end
View
12 Gemfile.lock
@@ -1,6 +1,7 @@
GEM
remote: http://rubygems.org/
specs:
+ Ascii85 (1.0.1)
actionmailer (3.1.1)
actionpack (= 3.1.1)
mail (~> 2.3.0)
@@ -70,6 +71,7 @@ GEM
memcached (1.3)
mime-types (1.16)
multi_json (1.0.3)
+ mysql (2.8.1)
nested_set (1.6.8)
activerecord (>= 3.0.0)
railties (>= 3.0.0)
@@ -80,7 +82,12 @@ GEM
net-ssh (2.2.1)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
+ pdf-reader (0.10.1)
+ Ascii85 (~> 1.0.0)
polyglot (0.3.2)
+ prawn (0.12.0)
+ pdf-reader (>= 0.9.0)
+ ttfunk (~> 1.0.2)
rack (1.3.4)
rack-cache (1.1)
rack (>= 0.4)
@@ -122,13 +129,13 @@ GEM
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- sqlite3 (1.3.4)
state_machine (1.0.2)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
+ ttfunk (1.0.3)
tzinfo (0.3.30)
uglifier (1.0.3)
execjs (>= 0.3.0)
@@ -152,12 +159,13 @@ DEPENDENCIES
jquery-rails
machinist
memcached
+ mysql
nested_set
+ prawn
rails
sass
sass-rails
shoulda
- sqlite3
state_machine
uglifier
unicorn
View
2  app/models/transactions/record.rb
@@ -3,5 +3,7 @@ class Record < ActiveRecord::Base
belongs_to :entry, :inverse_of => :records
belongs_to :account, :inverse_of => :records
+ delegate :name, :to => :account, :prefix => true
+
end
View
2  app/models/transactions/transaction.rb
@@ -1,5 +1,5 @@
class Transaction < Record
-
+
validates :amount_in_cents,
:presence => true,
:numericality => true
View
2  app/views/entries/show.html.haml
@@ -63,7 +63,7 @@
%tbody
-resource.transactions.each do |xact|
%tr
- %td.first= link_to xact.account.name, account_path(xact.account)
+ %td.first= link_to xact.account_name, account_path(xact.account)
%td
%td
%td.last= number_to_currency(xact.amount)
View
28 config/database.yml
@@ -1,28 +0,0 @@
-# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- pool: 5
- timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- pool: 5
- timeout: 5000
-
-demo:
- adapter: sqlite3
- database: /var/www/dev/regdel/shared/db/demo.sqlite3
- pool: 5
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: ../shared/db/production.sqlite3
- pool: 5
- timeout: 5000
View
10 config/deploy.rb
@@ -9,3 +9,13 @@
set :normalize_asset_timestamps, false
server '192.168.8.121', :app, :web, :db, :primary => true
+
+after "deploy:update_code", "db:symlink"
+
+
+namespace :db do
+ desc "Make symlink for database yaml"
+ task :symlink do
+ run "ln -nfs #{shared_path}/config/database.yml #{latest_release}/config/database.yml"
+ end
+end
View
44 lib/tasks/vlad.rake
@@ -1,44 +0,0 @@
-begin
- require 'vlad'
- Vlad.load :scm => :git
-rescue
- # do nothing
-end
-
-namespace :vlad do
- remote_task :mkdaemon do
- run "mkdir -p /tmp/#{myapp}/log"
- run "echo '#!/bin/sh' > /tmp/#{myapp}/run"
- run "echo 'exec /var/www/dev/#{myapp}/current/demo.sh' >> /tmp/#{myapp}/run"
- run "echo '#!/bin/sh' > /tmp/#{myapp}/log/run"
- run "echo 'exec setuidgid daemon multilog t ./main' >> /tmp/#{myapp}/log/run"
- run "sudo chown -R root:root /tmp/#{myapp}"
- run "sudo chmod +x /tmp/#{myapp}/run"
- run "sudo chmod +x /tmp/#{myapp}/log/run"
- run "sudo mv /tmp/#{myapp} /service/"
- end
- remote_task :bundle do
- run "cd /var/www/dev/#{myapp}/current/ && ~/.rvm/bin/rvm exec bundle install --path /var/www/dev/appgems"
- end
- remote_task :render do
- run "cd /var/www/dev/#{myapp}/current/ && /var/lib/gems/1.9.1/bin/bundle exec rake render:partials"
- end
- remote_task :migrate do
- run "cd /var/www/dev/#{myapp}/current/ && /var/lib/gems/1.9.1/bin/bundle exec rake db:migrate"
- end
- remote_task :seed do
- run "cd /var/www/dev/#{myapp}/current/ && /var/lib/gems/1.9.1/bin/bundle exec rake db:seed"
- end
- remote_task :restart do
- run "sudo svc -d /service/#{myapp}"
- run "sudo svc -u /service/#{myapp}"
- end
- remote_task :fix do
- run "mkdir -p /var/www/dev/#{myapp}/current/public/d/xhtml"
- run "chmod 0777 /var/www/dev/#{myapp}/current/public/d/xhtml"
- end
- remote_task :logtail do
- run "tail /tmp/webapps/#{myapp}.log -n 100"
- end
- task :deploy => [:update, :bundle, :restart, :fix]
-end
Please sign in to comment.
Something went wrong with that request. Please try again.