We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9dc454 commit 55dfa00Copy full SHA for 55dfa00
activesupport/lib/active_support/core_ext/module/aliasing.rb
@@ -65,6 +65,9 @@ def alias_method_chain(target, feature)
65
# e.subject = "Megastars"
66
# e.title # => "Megastars"
67
def alias_attribute(new_name, old_name)
68
+ # The following reader methods use an explicit `self` receiver in otder to
69
+ # support aliases that start with an uppercase letter. Otherwise, they would
70
+ # be resolved as constants instead.
71
module_eval <<-STR, __FILE__, __LINE__ + 1
72
def #{new_name}; self.#{old_name}; end # def subject; self.title; end
73
def #{new_name}?; self.#{old_name}?; end # def subject?; self.title?; end
0 commit comments