mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
69 specs fail in rails 4 now ...not too bad
This commit is contained in:
parent
33e3f123b4
commit
9e4b0df7ff
6 changed files with 24 additions and 11 deletions
7
Gemfile
7
Gemfile
|
@ -10,8 +10,10 @@ module Bundler::SharedHelpers
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def rails4?
|
module ::Kernel
|
||||||
|
def rails4?
|
||||||
!!ENV["RAILS4"]
|
!!ENV["RAILS4"]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if rails4?
|
if rails4?
|
||||||
|
@ -36,6 +38,7 @@ if rails4?
|
||||||
gem 'rails-observers'
|
gem 'rails-observers'
|
||||||
gem 'protected_attributes'
|
gem 'protected_attributes'
|
||||||
gem 'actionpack-action_caching'
|
gem 'actionpack-action_caching'
|
||||||
|
gem 'seed-fu' , github: 'mbleigh/seed-fu'
|
||||||
else
|
else
|
||||||
# we had pain with the 3.2.13 upgrade so monkey patch the security fix
|
# we had pain with the 3.2.13 upgrade so monkey patch the security fix
|
||||||
# next time around we hope to upgrade
|
# next time around we hope to upgrade
|
||||||
|
@ -45,6 +48,7 @@ else
|
||||||
# REVIEW EVERY RELEASE
|
# REVIEW EVERY RELEASE
|
||||||
gem 'sprockets', git: 'https://github.com/SamSaffron/sprockets.git', branch: 'rails-compat'
|
gem 'sprockets', git: 'https://github.com/SamSaffron/sprockets.git', branch: 'rails-compat'
|
||||||
gem 'redis-rails'
|
gem 'redis-rails'
|
||||||
|
gem 'seed-fu'
|
||||||
end
|
end
|
||||||
|
|
||||||
gem 'redis'
|
gem 'redis'
|
||||||
|
@ -105,7 +109,6 @@ gem 'rest-client'
|
||||||
gem 'rinku'
|
gem 'rinku'
|
||||||
gem 'sanitize'
|
gem 'sanitize'
|
||||||
gem 'sass'
|
gem 'sass'
|
||||||
gem 'seed-fu'
|
|
||||||
gem 'sidekiq'
|
gem 'sidekiq'
|
||||||
gem 'sidekiq-failures'
|
gem 'sidekiq-failures'
|
||||||
gem 'sinatra', require: nil
|
gem 'sinatra', require: nil
|
||||||
|
|
|
@ -17,6 +17,14 @@ GIT
|
||||||
redis-activesupport (>= 3.2.3)
|
redis-activesupport (>= 3.2.3)
|
||||||
redis-store (~> 1.1.0)
|
redis-store (~> 1.1.0)
|
||||||
|
|
||||||
|
GIT
|
||||||
|
remote: git://github.com/mbleigh/seed-fu.git
|
||||||
|
revision: f89ea306472c500ec7911c7be111a4aad9c1bc78
|
||||||
|
specs:
|
||||||
|
seed-fu (2.2.0)
|
||||||
|
activerecord (>= 3.1, < 4.1)
|
||||||
|
activesupport (>= 3.1, < 4.1)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/CodeMonkeySteve/fast_xor.git
|
remote: https://github.com/CodeMonkeySteve/fast_xor.git
|
||||||
revision: 85b79ec6d116f9680f23bd2c5c8c2c2039d477d8
|
revision: 85b79ec6d116f9680f23bd2c5c8c2c2039d477d8
|
||||||
|
@ -398,8 +406,6 @@ GEM
|
||||||
railties (>= 4.0.0.beta, < 5.0)
|
railties (>= 4.0.0.beta, < 5.0)
|
||||||
sass (>= 3.1.10)
|
sass (>= 3.1.10)
|
||||||
sprockets-rails (~> 2.0.0)
|
sprockets-rails (~> 2.0.0)
|
||||||
seed-fu (1.2.3)
|
|
||||||
rails (>= 2.1)
|
|
||||||
shoulda (3.5.0)
|
shoulda (3.5.0)
|
||||||
shoulda-context (~> 1.0, >= 1.0.1)
|
shoulda-context (~> 1.0, >= 1.0.1)
|
||||||
shoulda-matchers (>= 1.4.1, < 3.0)
|
shoulda-matchers (>= 1.4.1, < 3.0)
|
||||||
|
@ -547,7 +553,7 @@ DEPENDENCIES
|
||||||
sanitize
|
sanitize
|
||||||
sass
|
sass
|
||||||
sass-rails
|
sass-rails
|
||||||
seed-fu
|
seed-fu!
|
||||||
shoulda
|
shoulda
|
||||||
sidekiq
|
sidekiq
|
||||||
sidekiq-failures
|
sidekiq-failures
|
||||||
|
|
|
@ -51,7 +51,11 @@ class Topic < ActiveRecord::Base
|
||||||
self.title = TextCleaner.clean_title(TextSentinel.title_sentinel(title).text) if errors[:title].empty?
|
self.title = TextCleaner.clean_title(TextSentinel.title_sentinel(title).text) if errors[:title].empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if rails4?
|
||||||
|
store_accessor :meta_data
|
||||||
|
else
|
||||||
serialize :meta_data, ActiveRecord::Coders::Hstore
|
serialize :meta_data, ActiveRecord::Coders::Hstore
|
||||||
|
end
|
||||||
|
|
||||||
belongs_to :category
|
belongs_to :category
|
||||||
has_many :posts
|
has_many :posts
|
||||||
|
|
|
@ -93,7 +93,7 @@ module Discourse
|
||||||
# dumping rack lock cause the message bus does not work with it (throw :async, it catches Exception)
|
# dumping rack lock cause the message bus does not work with it (throw :async, it catches Exception)
|
||||||
# see: https://github.com/sporkrb/spork/issues/66
|
# see: https://github.com/sporkrb/spork/issues/66
|
||||||
# rake assets:precompile also fails
|
# rake assets:precompile also fails
|
||||||
config.threadsafe! unless $PROGRAM_NAME =~ /spork|rake/
|
config.threadsafe! unless rails4? || $PROGRAM_NAME =~ /spork|rake/
|
||||||
|
|
||||||
# route all exceptions via our router
|
# route all exceptions via our router
|
||||||
config.exceptions_app = self.routes
|
config.exceptions_app = self.routes
|
||||||
|
|
|
@ -7,7 +7,8 @@ Discourse::Application.configure do
|
||||||
config.cache_classes = false
|
config.cache_classes = false
|
||||||
|
|
||||||
# Log error messages when you accidentally call methods on nil.
|
# Log error messages when you accidentally call methods on nil.
|
||||||
config.whiny_nils = true
|
config.whiny_nils = true unless rails4?
|
||||||
|
config.eager_load = false if rails4?
|
||||||
|
|
||||||
# Show full error reports and disable caching
|
# Show full error reports and disable caching
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
|
|
|
@ -49,9 +49,8 @@ Spork.prefork do
|
||||||
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# let's not run seed_fu every test
|
# let's not run seed_fu every test
|
||||||
SeedFu.quiet = true
|
SeedFu.quiet = true if SeedFu.respond_to? :quiet
|
||||||
SeedFu.seed
|
SeedFu.seed
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|
Loading…
Reference in a new issue