Skip to content

Commit

Permalink
Merge pull request #195 from MushroomObserver/ror41
Browse files Browse the repository at this point in the history
Ruby on Rails 4.1
  • Loading branch information
mo-nathan committed Nov 16, 2015
2 parents a538a4b + 200dd2d commit f93ce3d
Show file tree
Hide file tree
Showing 21 changed files with 172 additions and 124 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ before_script:
- rake db:schema:load
- rake db:fixtures:load
- rake lang:update
- ls config/locales
- grep validate_observation_user_missing config/locales/*
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

# To bundle edge Rails instead: gem "rails", github: "rails/rails"
gem "rails", "~> 4.0.0"
gem "rails", "~> 4.1.0"

# Use mysql2 as db connector
# See https://github.com/brianmario/mysql2
Expand Down
101 changes: 52 additions & 49 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,46 @@ GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
actionmailer (4.0.13)
actionpack (= 4.0.13)
actionmailer (4.1.14)
actionpack (= 4.1.14)
actionview (= 4.1.14)
mail (~> 2.5, >= 2.5.4)
actionpack (4.0.13)
activesupport (= 4.0.13)
builder (~> 3.1.0)
erubis (~> 2.7.0)
actionpack (4.1.14)
actionview (= 4.1.14)
activesupport (= 4.1.14)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.13)
activesupport (= 4.0.13)
builder (~> 3.1.0)
activerecord (4.0.13)
activemodel (= 4.0.13)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.13)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.4)
activesupport (4.0.13)
actionview (4.1.14)
activesupport (= 4.1.14)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.14)
activesupport (= 4.1.14)
builder (~> 3.1)
activerecord (4.1.14)
activemodel (= 4.1.14)
activesupport (= 4.1.14)
arel (~> 5.0.0)
activesupport (4.1.14)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
tzinfo (~> 1.1)
ansi (1.5.0)
arel (4.0.2)
arel (5.0.1.20140414130214)
ast (2.1.0)
astrolabe (1.3.1)
parser (~> 2.2)
autoprefixer-rails (6.1.0.1)
execjs
json
aws-sdk (2.1.35)
aws-sdk-resources (= 2.1.35)
aws-sdk-core (2.1.35)
aws-sdk (2.2.0)
aws-sdk-resources (= 2.2.0)
aws-sdk-core (2.2.0)
jmespath (~> 1.0)
aws-sdk-resources (2.1.35)
aws-sdk-core (= 2.1.35)
aws-sdk-resources (2.2.0)
aws-sdk-core (= 2.2.0)
blankslate (3.1.3)
bootstrap-sass (3.3.5.1)
autoprefixer-rails (>= 5.0.0.1)
Expand All @@ -57,21 +59,22 @@ GEM
slim (>= 1.3.6, < 4.0)
terminal-table (~> 1.4)
browser (1.0.1)
builder (3.1.4)
byebug (8.0.0)
builder (3.2.2)
byebug (8.2.0)
coffee-rails (4.1.0)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
coveralls (0.8.3)
coffee-script-source (1.10.0)
coveralls (0.8.9)
json (~> 1.8)
rest-client (>= 1.6.8, < 2)
simplecov (~> 0.10.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
cure_acts_as_versioned (0.6.3)
activerecord (>= 3.0.9)
docile (1.1.5)
Expand All @@ -83,7 +86,6 @@ GEM
fastercsv (1.5.5)
haml (4.0.7)
tilt
hashie (3.4.3)
highline (1.7.8)
http-cookie (1.0.2)
domain_name (~> 0.5)
Expand All @@ -100,35 +102,34 @@ GEM
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.6.2)
minitest (4.7.5)
minitest-reporters (0.14.24)
minitest (5.8.2)
minitest-reporters (1.1.5)
ansi
builder
minitest (>= 2.12, < 5.0)
powerbar
minitest (>= 5.0)
ruby-progressbar
multi_json (1.11.2)
mysql2 (0.3.20)
netrc (0.11.0)
parser (2.2.3.0)
ast (>= 1.1, < 3.0)
powerbar (1.0.12)
ansi (~> 1.5.0)
hashie (>= 1.1.0)
powerpack (0.1.1)
rack (1.5.5)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.0.13)
actionmailer (= 4.0.13)
actionpack (= 4.0.13)
activerecord (= 4.0.13)
activesupport (= 4.0.13)
rails (4.1.14)
actionmailer (= 4.1.14)
actionpack (= 4.1.14)
actionview (= 4.1.14)
activemodel (= 4.1.14)
activerecord (= 4.1.14)
activesupport (= 4.1.14)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.13)
railties (= 4.1.14)
sprockets-rails (~> 2.0)
railties (4.0.13)
actionpack (= 4.0.13)
activesupport (= 4.0.13)
railties (4.1.14)
actionpack (= 4.1.14)
activesupport (= 4.1.14)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
Expand All @@ -140,12 +141,13 @@ GEM
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rtf (0.3.3)
rubocop (0.35.0)
rubocop (0.35.1)
astrolabe (~> 1.3)
parser (>= 2.2.3.0, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
tins (<= 1.6.0)
ruby-progressbar (1.7.5)
ruby2ruby (2.2.0)
ruby_parser (~> 3.1)
Expand Down Expand Up @@ -188,7 +190,8 @@ GEM
thread_safe (0.3.5)
tilt (2.0.1)
tins (1.6.0)
tzinfo (0.3.45)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
Expand Down Expand Up @@ -221,7 +224,7 @@ DEPENDENCIES
minitest
minitest-reporters (>= 0.5.0)
mysql2 (~> 0.3.18)
rails (~> 4.0.0)
rails (~> 4.1.0)
rtf
rubocop
sass-rails
Expand Down
2 changes: 1 addition & 1 deletion app/classes/pattern_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#
################################################################################

class API
module PatternSearch
require_dependency "pattern_search/base"
require_dependency "pattern_search/parser"
require_dependency "pattern_search/term"
Expand Down
9 changes: 6 additions & 3 deletions app/controllers/observer_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,7 @@ def edit_observation # :prefetch: :norobots:
else
any_errors = false

# Update observation attributes
@observation.attributes = whitelisted_observation_params
update_whitelisted_observation_attributes

# Validate place name
@place_name = @observation.place_name
Expand Down Expand Up @@ -1257,6 +1256,10 @@ def edit_observation # :prefetch: :norobots:
end
end

def update_whitelisted_observation_attributes
@observation.attributes = whitelisted_observation_params || {}
end

# Callback to destroy an observation (and associated namings, votes, etc.)
# Linked from: show_observation
# Inputs: params[:id] (observation)
Expand Down Expand Up @@ -2294,7 +2297,7 @@ def whitelisted_observation_args
end

def whitelisted_observation_params
return nil unless params[:observation]
return unless params[:observation]
params[:observation].permit(whitelisted_observation_args)
end
end
1 change: 1 addition & 0 deletions app/models/language_exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def locales_dir
def locales_path=(path)
@locales_path = path
FileUtils.mkdir_p(locales_dir) unless File.directory?(locales_dir)
File.open("#{locales_dir}/en.txt", "a").close()
end

def alt_locales_path(path, &block)
Expand Down
4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<%= auto_discovery_link_tag(:rss, {controller: :observer, action: :rss}, {title: :app_rss.l}) %>
<title><%= :app_title.l %>: <%= @title.nil? ? controller.action_name : @title.strip_html.html_safe %></title>
<link rel="SHORTCUT ICON" href="http://mushroomobserver.org/favicon.ico"/>
<%= content_tag(:link, "", rel: "canonical", href: escape_once(@canonical_url)) if @canonical_url %>
<% if @canonical_url %>
<link href="<%= escape_once(@canonical_url) %>" rel="canonical"/>
<% end %>
<%= csrf_meta_tag %>
<meta property="og:image" content="http://mushroomobserver.org/images/facebook_icon.png"/>
<meta property="og:title" content="Mushroom Observer"/>
Expand Down
Loading

0 comments on commit f93ce3d

Please sign in to comment.