Skip to content

Commit fd494f8

Browse files
authored
Merge pull request #324 from coopdevs/develop
Release February 2018 / 1
2 parents 6660a79 + 4578ab0 commit fd494f8

File tree

14 files changed

+222
-13
lines changed

14 files changed

+222
-13
lines changed

Capfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ require 'capistrano/deploy'
1616
# https://github.com/capistrano/passenger
1717
#
1818
require 'capistrano/rails'
19+
require 'capistrano/rbenv'
1920

2021
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
2122
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ gem 'prawn-table'
2626
gem 'bundler', '>= 1.10.6'
2727
gem 'elasticsearch-model'
2828
gem 'elasticsearch-rails'
29+
gem 'skylight'
2930

3031
# Assets
3132
gem 'jquery-rails', '4.0.4'
@@ -46,6 +47,7 @@ group :development do
4647
gem 'web-console', '2.1.3'
4748
gem 'capistrano', '~> 3.1'
4849
gem 'capistrano-rails', '~> 1.1'
50+
gem 'capistrano-rbenv', '~> 2.1'
4951
gem 'airbrussh', require: false
5052
gem "quiet_assets"
5153
gem 'localeapp', '2.1.1', require: false

Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ GEM
9393
capistrano-rails (1.1.5)
9494
capistrano (~> 3.1)
9595
capistrano-bundler (~> 1.1)
96+
capistrano-rbenv (2.1.3)
97+
capistrano (~> 3.1)
98+
sshkit (~> 1.3)
9699
capybara (2.4.4)
97100
mime-types (>= 1.16)
98101
nokogiri (>= 1.3.3)
@@ -327,6 +330,8 @@ GEM
327330
simple_form (3.1.0)
328331
actionpack (~> 4.0)
329332
activemodel (~> 4.0)
333+
skylight (1.5.0)
334+
activesupport (>= 3.0.0)
330335
sprockets (3.7.1)
331336
concurrent-ruby (~> 1.0)
332337
rack (> 1, < 3)
@@ -382,6 +387,7 @@ DEPENDENCIES
382387
byebug
383388
capistrano (~> 3.1)
384389
capistrano-rails (~> 1.1)
390+
capistrano-rbenv (~> 2.1)
385391
capybara (~> 2.4.4)
386392
coffee-rails
387393
dalli
@@ -421,6 +427,7 @@ DEPENDENCIES
421427
select2-rails
422428
shoulda (>= 3.5)
423429
simple_form (>= 3.0.0)
430+
skylight
424431
thin
425432
uglifier (= 2.7.2)
426433
unicorn

app/controllers/offers_controller.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,11 @@ def dashboard
1818
offers[category] = list if list.present?
1919
end
2020
end
21+
22+
def show
23+
super
24+
25+
member = @offer.user.members.find_by(organization: current_organization)
26+
@destination_account = member.account if member
27+
end
2128
end

app/models/post.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def self.inherited(child)
4343
belongs_to :user
4444
belongs_to :organization
4545
belongs_to :publisher, class_name: "User", foreign_key: "publisher_id"
46-
# belongs_to :member, class_name: "Member", foreign_key: "user_id"
4746
has_many :user_members, class_name: "Member", through: :user, source: :members
4847
has_many :transfers
4948
has_many :movements, through: :transfers

app/views/offers/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<% end %>
1313
<% end %>
1414
<% if current_user and @offer.user != current_user %>
15-
<%= link_to new_transfer_path(id: @offer.user.id, offer: @offer.id),
15+
<%= link_to new_transfer_path(id: @offer.user.id, offer: @offer.id, destination_account_id: @destination_account.id),
1616
class: "btn btn-success" do %>
1717
<%= glyph :time %>
1818
<%= t ".give_time_for" %>

config/database.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ test:
2525
<<: *defaults
2626
database: <%= ENV.fetch('DATABASE_NAME', 'timeoverflow_test') %>
2727

28+
staging:
29+
<<: *defaults
30+
database: <%= ENV.fetch('DATABASE_NAME', 'timeoverflow_staging') %>
31+
2832
production:
2933
# Set DATABASE_URL environment variable
3034
url: <%= ENV['DATABASE_URL'] %>

config/deploy.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
set :application, 'timeoverflow'
55
set :repo_url, 'git@github.com:coopdevs/timeoverflow.git'
66

7+
set :rbenv_type, :user
8+
79
# Default branch is :master
8-
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
10+
ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
911

1012
# Default deploy_to directory is /var/www/my_app_name
1113
# set :deploy_to, '/var/www/my_app_name'

config/deploy/staging.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
server 'staging.timeoverflow.org', user: 'timeoverflow', roles: %w(app db web)

config/environments/staging.rb

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
Rails.application.configure do
2+
# Settings specified here will take precedence over those in config/application.rb.
3+
4+
# Code is not reloaded between requests.
5+
config.cache_classes = true
6+
7+
# Eager load code on boot. This eager loads most of Rails and
8+
# your application in memory, allowing both threaded web servers
9+
# and those relying on copy on write to perform better.
10+
# Rake tasks automatically ignore this option for performance.
11+
config.eager_load = true
12+
13+
# Full error reports are disabled and caching is turned on.
14+
config.consider_all_requests_local = false
15+
config.action_controller.perform_caching = true
16+
17+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
18+
# Add `rack-cache` to your Gemfile before enabling this.
19+
# For large-scale production use, consider using a caching reverse proxy like
20+
# NGINX, varnish or squid.
21+
# config.action_dispatch.rack_cache = true
22+
23+
# Disable serving static files from the `/public` folder by default since
24+
# Apache or NGINX already handles this.
25+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26+
27+
# Compress JavaScripts and CSS.
28+
config.assets.js_compressor = :uglifier
29+
# config.assets.css_compressor = :sass
30+
31+
# Do not fallback to assets pipeline if a precompiled asset is missed.
32+
config.assets.compile = true # false
33+
34+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
35+
# yet still be able to expire them through the digest params.
36+
config.assets.digest = true
37+
38+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39+
40+
# Specifies the header that your server uses for sending files.
41+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43+
44+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45+
config.force_ssl = true
46+
47+
# Use the lowest log level to ensure availability of diagnostic information
48+
# when problems arise.
49+
config.log_level = :debug
50+
51+
# Prepend all log lines with the following tags.
52+
# config.log_tags = [ :subdomain, :uuid ]
53+
54+
# Use a different logger for distributed setups.
55+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56+
57+
# Use a different cache store in production.
58+
# config.cache_store = :mem_cache_store
59+
config.cache_store = :dalli_store
60+
61+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
62+
# config.action_controller.asset_host = 'http://assets.example.com'
63+
64+
# Ignore bad email addresses and do not raise email delivery errors.
65+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
66+
config.action_mailer.raise_delivery_errors = true
67+
68+
config.action_mailer.delivery_method = :smtp
69+
config.action_mailer.default_url_options = {
70+
host: ENV["MAIL_LINK_HOST"],
71+
protocol: (ENV["MAIL_LINK_PROTO"] || "https")
72+
}
73+
74+
# Retrieve SMTP configuration from environment variables
75+
# starting with `SMTP_`
76+
smtp_env = Hash[ENV.map do |k,v|
77+
if /^SMTP_(.*)$/ === k
78+
[$1.downcase.to_sym, YAML.load(v)]
79+
end
80+
end.compact]
81+
82+
if smtp_env.present?
83+
config.action_mailer.smtp_settings = smtp_env
84+
end
85+
86+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
87+
# the I18n.default_locale when a translation cannot be found).
88+
config.i18n.fallbacks = true
89+
90+
# Send deprecation notices to registered listeners.
91+
config.active_support.deprecation = :notify
92+
93+
# Use default logging formatter so that PID and timestamp are not suppressed.
94+
config.log_formatter = ::Logger::Formatter.new
95+
96+
# Do not dump schema after migrations.
97+
config.active_record.dump_schema_after_migration = false
98+
end

0 commit comments

Comments
 (0)