Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dealing with rails 3.2 deprecation warning

  • Loading branch information...
commit 6da93cb2d235384b23af29a3ae27976106b456ed 1 parent 86d8d41
Oleg GBH authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  app/models/cms/layout.rb
  2. +1 −1  test/unit/models/layout_test.rb
2  app/models/cms/layout.rb
View
@@ -49,7 +49,7 @@ def self.options_for_select(site, layout = nil, current_layout = nil, depth = 0,
def self.app_layouts_for_select
Dir.glob(File.expand_path('app/views/layouts/**/*.html.*', Rails.root)).collect do |filename|
filename.gsub!("#{File.expand_path('app/views/layouts', Rails.root)}/", '')
- filename.split('/').last[0...1] == '_' ? nil : filename
+ filename.split('/').last[0...1] == '_' ? nil : filename.split('.').first
end.compact.sort
end
2  test/unit/models/layout_test.rb
View
@@ -55,7 +55,7 @@ def test_app_layouts_for_select
FileUtils.touch(File.expand_path('app/views/layouts/_partial.html.erb', Rails.root))
FileUtils.touch(File.expand_path('app/views/layouts/not_a_layout.erb', Rails.root))
- assert_equal ['cms_admin.html.erb', 'cms_admin/nested.html.erb'], Cms::Layout.app_layouts_for_select
+ assert_equal ['cms_admin', 'cms_admin/nested'], Cms::Layout.app_layouts_for_select
FileUtils.rm(File.expand_path('app/views/layouts/cms_admin/nested.html.erb', Rails.root))
FileUtils.rm(File.expand_path('app/views/layouts/_partial.html.erb', Rails.root))
Please sign in to comment.
Something went wrong with that request. Please try again.