Skip to content

Commit

Permalink
Upgrade to rails 4.2.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
martini committed Sep 25, 2015
1 parent dabc93a commit ad1b9b1
Show file tree
Hide file tree
Showing 27 changed files with 268 additions and 194 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'http://rubygems.org'

gem 'rails', '4.1.13'
gem 'rails', '4.2.4'
gem 'rails-observers'
gem 'activerecord-session_store'

Expand Down
116 changes: 72 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,51 @@ GEM
remote: http://rubygems.org/
specs:
abstract_type (0.0.7)
actionmailer (4.1.13)
actionpack (= 4.1.13)
actionview (= 4.1.13)
actionmailer (4.2.4)
actionpack (= 4.2.4)
actionview (= 4.2.4)
activejob (= 4.2.4)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.13)
actionview (= 4.1.13)
activesupport (= 4.1.13)
rack (~> 1.5.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.4)
actionview (= 4.2.4)
activesupport (= 4.2.4)
rack (~> 1.6)
rack-test (~> 0.6.2)
actionview (4.1.13)
activesupport (= 4.1.13)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.4)
activesupport (= 4.2.4)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.13)
activesupport (= 4.1.13)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.4)
activesupport (= 4.2.4)
globalid (>= 0.3.0)
activemodel (4.2.4)
activesupport (= 4.2.4)
builder (~> 3.1)
activerecord (4.1.13)
activemodel (= 4.1.13)
activesupport (= 4.1.13)
arel (~> 5.0.0)
activerecord (4.2.4)
activemodel (= 4.2.4)
activesupport (= 4.2.4)
arel (~> 6.0)
activerecord-session_store (0.1.1)
actionpack (>= 4.0.0, < 5)
activerecord (>= 4.0.0, < 5)
railties (>= 4.0.0, < 5)
activesupport (4.1.13)
i18n (~> 0.6, >= 0.6.9)
activesupport (4.2.4)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.8)
arel (5.0.1.20140414130214)
arel (6.0.3)
ast (2.1.0)
astrolabe (1.3.1)
parser (~> 2.2)
autoprefixer-rails (6.0.2)
autoprefixer-rails (6.0.3)
execjs
json
biz (1.3.0)
Expand All @@ -62,11 +71,11 @@ GEM
execjs
coffee-script-source (1.9.1.1)
daemons (1.2.3)
delayed_job (4.0.6)
delayed_job (4.1.1)
activesupport (>= 3.0, < 5.0)
delayed_job_active_record (4.0.3)
activerecord (>= 3.0, < 5.0)
delayed_job (>= 3.0, < 4.1)
delayed_job_active_record (4.1.0)
activerecord (>= 3.0, < 5)
delayed_job (>= 3.0, < 5)
docile (1.1.5)
eco (1.0.0)
coffee-script
Expand All @@ -84,6 +93,8 @@ GEM
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
formatador (0.2.5)
globalid (0.3.6)
activesupport (>= 4.1.0)
guard (2.13.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
Expand Down Expand Up @@ -113,6 +124,8 @@ GEM
listen (3.0.3)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
loofah (2.0.3)
nokogiri (>= 1.5.9)
lumberjack (1.0.9)
mail (2.5.4)
mime-types (~> 1.16)
Expand All @@ -121,15 +134,18 @@ GEM
thread_safe (~> 0.3, >= 0.3.1)
method_source (0.8.2)
mime-types (1.25.1)
minitest (5.8.0)
mini_portile (0.6.2)
minitest (5.8.1)
multi_json (1.11.2)
multi_xml (0.5.5)
multipart-post (2.0.0)
mysql2 (0.3.20)
naught (1.1.0)
nenv (0.2.0)
net-ldap (0.11)
notiffany (0.0.7)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
notiffany (0.0.8)
nenv (~> 0.1)
shellany (~> 0.0)
oauth (0.4.7)
Expand Down Expand Up @@ -163,31 +179,40 @@ GEM
polyglot (0.3.5)
power_assert (0.2.4)
powerpack (0.1.1)
pry (0.10.1)
pry (0.10.2)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
puma (2.13.4)
rack (1.5.5)
puma (2.14.0)
rack (1.6.4)
rack-livereload (0.3.16)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.1.13)
actionmailer (= 4.1.13)
actionpack (= 4.1.13)
actionview (= 4.1.13)
activemodel (= 4.1.13)
activerecord (= 4.1.13)
activesupport (= 4.1.13)
rails (4.2.4)
actionmailer (= 4.2.4)
actionpack (= 4.2.4)
actionview (= 4.2.4)
activejob (= 4.2.4)
activemodel (= 4.2.4)
activerecord (= 4.2.4)
activesupport (= 4.2.4)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.13)
sprockets-rails (~> 2.0)
railties (= 4.2.4)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
loofah (~> 2.0)
rails-observers (0.1.2)
activemodel (~> 4.0)
railties (4.1.13)
actionpack (= 4.1.13)
activesupport (= 4.1.13)
railties (4.2.4)
actionpack (= 4.2.4)
activesupport (= 4.2.4)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
Expand All @@ -196,7 +221,7 @@ GEM
rb-inotify (0.9.5)
ffi (>= 0.5.0)
ref (2.0.0)
rubocop (0.34.1)
rubocop (0.34.2)
astrolabe (~> 1.3)
parser (>= 2.2.2.5, < 3.0)
powerpack (~> 0.1)
Expand Down Expand Up @@ -227,7 +252,7 @@ GEM
simplecov-rcov (0.2.3)
simplecov (>= 0.4.1)
slop (3.6.0)
spring (1.3.6)
spring (1.4.0)
sprockets (3.3.4)
rack (~> 1.0)
sprockets-rails (2.3.3)
Expand Down Expand Up @@ -298,7 +323,7 @@ DEPENDENCIES
omniauth-twitter
puma
rack-livereload
rails (= 4.1.13)
rails (= 4.2.4)
rails-observers
rb-fsevent
rubocop
Expand All @@ -315,3 +340,6 @@ DEPENDENCIES
twitter (~> 5.13.0)
uglifier
writeexcel

BUNDLED WITH
1.10.5
10 changes: 5 additions & 5 deletions app/assets/javascripts/app/controllers/_settings/area.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class App.SettingsAreaItem extends App.Controller
directValue += 1
if directValue > 1
for item in @setting.options['form']
item['default'] = @setting.state.value[item.name]
item['default'] = @setting.state_current.value[item.name]
else
item['default'] = @setting.state.value
item['default'] = @setting.state_current.value

# form
@configure_attributes = @setting.options['form']
Expand Down Expand Up @@ -97,17 +97,17 @@ class App.SettingsAreaItem extends App.Controller
directData = params[item.name]

if directValue > 1
state = {
state_current = {
value: params
}
#App.Config.set((@setting.name, params)
else
state = {
state_current = {
value: directData
}
#App.Config.set(@setting.name, directData)

@setting['state'] = state
@setting['state_current'] = state_current
ui = @
@setting.save(
done: =>
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/app/models/setting.js.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class App.Setting extends App.Model
@configure 'Setting', 'name', 'state'
@configure 'Setting', 'name', 'state_current'
@extend Spine.Model.Ajax
@url: @apiPath + '/settings'
20 changes: 11 additions & 9 deletions app/models/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class Setting < ApplicationModel
store :options
store :state
store :state_current
store :state_initial
store :preferences
before_create :state_check, :set_initial
Expand All @@ -11,6 +11,8 @@ class Setting < ApplicationModel
after_update :reset_cache
after_destroy :reset_cache

attr_accessor :state

@@current = {} # rubocop:disable Style/ClassVars
@@change_id = nil # rubocop:disable Style/ClassVars
@@lookup_at = nil # rubocop:disable Style/ClassVars
Expand All @@ -29,7 +31,7 @@ def self.set(name, value)
if !setting
fail "Can't find config setting '#{name}'"
end
setting.state = { value: value }
setting.state_current = { value: value }
setting.save
logger.info "Setting.set(#{name}, #{value.inspect})"
end
Expand Down Expand Up @@ -64,9 +66,9 @@ def self.reset(name)
if !setting
fail "Can't find config setting '#{name}'"
end
setting.state = setting.state_initial
setting.state_current = setting.state_initial
setting.save
logger.info "Setting.reset(#{name}, #{setting.state.inspect})"
logger.info "Setting.reset(#{name}, #{setting.state_current.inspect})"
load
@@current[:settings_config][name]
end
Expand All @@ -83,8 +85,8 @@ def self.load

# read all config settings
config = {}
Setting.select('name, state').order(:id).each { |setting|
config[setting.name] = setting.state[:value]
Setting.select('name, state_current').order(:id).each { |setting|
config[setting.name] = setting.state_current[:value]
}

# config lookups
Expand All @@ -103,7 +105,7 @@ def self.load

# set initial value in state_initial
def set_initial
self.state_initial = state
self.state_initial = state_current
end

# set new cache
Expand Down Expand Up @@ -141,7 +143,7 @@ def self.cache_valid?

# convert state ot hash to be able to store it as store
def state_check
return if state.respond_to?('has_key?') && state.key?(:value)
self.state = { value: state }
return if state && state.respond_to?('has_key?') && state.key?(:value)
self.state_current = { value: state }
end
end
3 changes: 3 additions & 0 deletions bin/bundle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
4 changes: 4 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
4 changes: 4 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run
29 changes: 29 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
require 'pathname'

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:

puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end

puts "\n== Preparing database =="
system "bin/rake db:setup"

puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"

puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end
Loading

0 comments on commit ad1b9b1

Please sign in to comment.