Skip to content

Commit 903b44d

Browse files
Undefine the writer method as well, and define our own
Since 3.0 doesn't have the assets/assets= methods defined, we need to define our own to make it work, and undefine the existent ones to avoid warnings.
1 parent 5b5c46a commit 903b44d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/sprockets/railtie.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require 'rails'
22
require 'rails/railtie'
33
require 'action_controller/railtie'
4+
require 'active_support/core_ext/module/remove_method'
45
require 'sprockets'
56
require 'sprockets/rails/helper'
6-
require 'active_support/core_ext/module/remove_method'
77

88
module Rails
99
class Application
@@ -15,6 +15,8 @@ class Configuration
1515

1616
# Undefine Rails' assets method before redefining it, to avoid warnings.
1717
remove_possible_method :assets
18+
remove_possible_method :assets=
19+
1820
# Returns Sprockets::Environment for app config.
1921
def assets
2022
return @assets if defined? @assets
@@ -30,6 +32,7 @@ def assets
3032
end
3133
end
3234
end
35+
attr_writer :assets
3336
end
3437
end
3538

0 commit comments

Comments
 (0)