Skip to content

Commit b4ba532

Browse files
author
Sean Crowe
committed
Merge pull request #116 from jamesvanmil/production_tweaks
fix bugs for production environment
2 parents 9216de8 + 36d95c8 commit b4ba532

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

app/controllers/marc_uploads_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
class MarcUploadsController < ApplicationController
22
before_filter :authenticate_user!
33
def create
4-
redirect_to '/marc_uploads' and flash[:notice] = 'Include file!' and return if params[:upload].nil?
4+
redirect_to marc_uploads_path and flash[:notice] = 'Include file!' and return if params[:upload].nil?
55
name = params[:upload][:file].original_filename
6-
redirect_to '/marc_uploads' and flash[:notice] = 'Input only .xlsx format files!' and return if File.extname(name) != '.xlsx'
6+
redirect_to marc_uploads_path and flash[:notice] = 'Input only .xlsx format files!' and return if File.extname(name) != '.xlsx'
77
directory = "public/tmp/records"
88
@path = File.join(directory, name)
99

1010
File.open(@path, "wb") { |f| f.write(params[:upload][:file].read) }
1111
s = Roo::Excelx.new(@path)
12-
redirect_to '/marc_uploads' and flash[:notice] = 'Columns must be in order: Label, Catalog, Title, UPC, Format, Invoice, Price' and return if s.row(1) != ['Label', 'Catalog', 'Title', 'UPC', 'Format', 'Invoice', 'Price']
12+
redirect_to marc_uploads_path and flash[:notice] = 'Columns must be in order: Label, Catalog, Title, UPC, Format, Invoice, Price' and return if s.row(1) != ['Label', 'Catalog', 'Title', 'UPC', 'Format', 'Invoice', 'Price']
1313

1414
writer = MARC::Writer.new("#{directory}/#{name.gsub('xlsx', 'mrc')}")
1515
s.drop(1).each do |row|
@@ -25,6 +25,6 @@ def create
2525
end
2626
writer.close()
2727
flash[:notice] = "Records Processed"
28-
redirect_to "/marc_downloads"
28+
redirect_to marc_downloads_path
2929
end
3030
end

app/mailers/order_mailer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class OrderMailer < ActionMailer::Base
2-
default from: "NO-REPLY@larry.libraries.uc.edu"
2+
default from: "NO-REPLY@lucy.libraries.uc.edu"
33

44
def new_order(user, order)
55
@user = user

app/views/marc_downloads/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<table class='table table-striped'>
55
<% Dir["public/tmp/records/*.*"].each do |file| %>
66
<tr>
7-
<td><%= link_to file[/[A-Za-z0-9_\.]*$/], file.gsub('public', '') %></td>
7+
<td><%= link_to File.basename(file), "#{root_url}tmp/records/#{File.basename(file)}" %></td>
88
</tr>
99
<% end %>
1010
</table>

app/views/marc_uploads/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<p class="lead">Upload Arkive invoices in *.xlsx format</p>
66

77
<div class="hero-unit">
8-
<%= form_tag '/marc_uploads/create', { :multipart => true } do %>
8+
<%= form_tag marc_uploads_create_path, { :multipart => true } do %>
99
<p>
1010

1111
<%= bootstrap_flash %>

app/views/order_mailer/new_order.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
</tr>
3535
</table>
3636
</p>
37-
<p><%= link_to orders_path(@order), orders_path(@order) %></p>
37+
<p><%= link_to order_url(@order), order_url(@order) %></p>
3838
</body>
3939
</html>

app/views/orders/_show_admin_actions.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</a>
99
<ul class="dropdown-menu">
1010
<% @order.current_state.events.keys.each do |i| %>
11-
<li> <%= link_to model_class.human_attribute_name(i), "/orders/#{@order.id}/#{i}", method: :put, data: {confirm: 'Are you sure?'}
11+
<li> <%= link_to model_class.human_attribute_name(i), "#{root_url}orders/#{@order.id}/#{i}", method: :put, data: {confirm: 'Are you sure?'}
1212
%> </li>
1313
<% end %>
1414
</ul>

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
module SelectorReporting
99
class Application < Rails::Application
10-
config.action_mailer.default_url_options = { host: 'example.com' }
10+
config.action_mailer.default_url_options = { host: 'lucy.libraries.uc.edu' }
1111
config.autoload_paths += %W(#{config.root}/app/models/users)
1212
# Settings in config/environments/* take precedence over those specified here.
1313
# Application configuration should go into files in config/initializers

config/environments/development.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# every request. This slows down response time but is perfect for development
66
# since you don't have to restart the web server when you make code changes.
77
config.cache_classes = false
8-
98
# Do not eager load code on boot.
109
config.eager_load = false
1110

config/environments/production.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
SelectorReporting::Application.configure do
22
# Settings specified here will take precedence over those in config/application.rb.
33

4+
45
# Code is not reloaded between requests.
56
config.cache_classes = true
67

db/migrate/20140328162816_create_losts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def change
33
create_table :losts do |t|
44
t.integer :item_number
55
t.integer :bib_number
6-
t.string :title
6+
t.text :title
77
t.string :imprint
88
t.string :isbn
99
t.string :status

0 commit comments

Comments
 (0)