Skip to content

Commit

Permalink
solves more deprecation issues (needs to be revisited)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtwohiou committed Apr 11, 2017
1 parent 6e32883 commit a24bb32
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/controllers/cms/content_block_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def update_block
def model_params
defaults = {"publish_on_save" => false}
model_params = params[model_form_name]
defaults.merge(model_params)
defaults.merge(model_params.to_unsafe_h)
end

def after_update_on_success
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/cms/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class UsersController < Cms::ResourceController

check_permissions :administrate, :except => [:change_password, :update_password]
before_action :only_self_or_administrator, :only => [:change_password, :update_password]
after_filter :update_flash, :only => [:update]
after_action :update_flash, :only => [:update]

def index
@have_external_users = Cms::ExternalUser.count > 0
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/tests/pretend_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class Tests::PretendController < ApplicationController
RESTRICTED_H1 = "Restricted"

def restricted
render :text =>"<h1>#{RESTRICTED_H1}</h1> You can see this restricted page."
render plain: "<h1>#{RESTRICTED_H1}</h1> You can see this restricted page."
end

def open
render :text =>"<h1>Open Page</h1> You can see this public page."
render plain: "<h1>Open Page</h1> You can see this public page."
end

def error
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/cms/path_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def sortable_column_path(content_type, column_to_sort)
filtered_params.delete(:action)
filtered_params.delete(:controller)
filtered_params.merge!(:order => determine_order(filtered_params[:order], column_to_sort))
polymorphic_path(engine_aware_path(content_type.model_class), filtered_params)
polymorphic_path(engine_aware_path(content_type.model_class), filtered_params.to_unsafe_h)
end

def link_to_usages(block)
Expand Down
1 change: 0 additions & 1 deletion test/support/engine_controller_hacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def delete(action, parameters = nil, session = nil, flash = nil)
end

private

def process_action(action, parameters = nil, session = nil, flash = nil, method = "GET")
parameters ||= {}
merge = { :use_route => :cms }
Expand Down
4 changes: 2 additions & 2 deletions test/unit/models/file_block_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ def setup

test "#valid? requires attached file" do
refute @file.valid?
assert_equal ["You must upload a file"], @file.errors.get(:attachment)
assert_equal ["You must upload a file"], @file.errors[:attachment]
end

test "#valid? requires Name" do
refute @file.valid?
assert_equal ["can't be blank"], @file.errors.get(:name)
assert_equal ["can't be blank"], @file.errors[:name]
end

test "New FileBlock should have 1 blank attachment" do
Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema_statements_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ::Cms::NonVersionedBlock < ActiveRecord::Base
connection.drop_table :non_versioned_block_versions rescue nil
connection.create_content_table :non_versioned_blocks, :versioned=>false do |t| ; end

assert_equal false, ActiveRecord::Base.connection.table_exists?(:non_versioned_block_versions)
assert_equal false, ActiveRecord::Base.connection.data_source_exists?(:non_versioned_block_versions)
end


Expand Down

0 comments on commit a24bb32

Please sign in to comment.