Skip to content
This repository
Browse code

Merge pull request #10909 from dockyard/master

Use symbols instead of strings in ActiveSupport::Concern
  • Loading branch information...
commit b296edd2d89623f97218fd1693b7a188b01e2171 2 parents 161c3af + 748d3f3
Carlos Antonio da Silva authored July 02, 2013
12  activesupport/lib/active_support/concern.rb
@@ -105,25 +105,25 @@ def initialize
105 105
     end
106 106
 
107 107
     def self.extended(base) #:nodoc:
108  
-      base.instance_variable_set("@_dependencies", [])
  108
+      base.instance_variable_set(:@_dependencies, [])
109 109
     end
110 110
 
111 111
     def append_features(base)
112  
-      if base.instance_variable_defined?("@_dependencies")
113  
-        base.instance_variable_get("@_dependencies") << self
  112
+      if base.instance_variable_defined?(:@_dependencies)
  113
+        base.instance_variable_get(:@_dependencies) << self
114 114
         return false
115 115
       else
116 116
         return false if base < self
117 117
         @_dependencies.each { |dep| base.send(:include, dep) }
118 118
         super
119  
-        base.extend const_get("ClassMethods") if const_defined?("ClassMethods")
120  
-        base.class_eval(&@_included_block) if instance_variable_defined?("@_included_block")
  119
+        base.extend const_get(:ClassMethods) if const_defined?(:ClassMethods)
  120
+        base.class_eval(&@_included_block) if instance_variable_defined?(:@_included_block)
121 121
       end
122 122
     end
123 123
 
124 124
     def included(base = nil, &block)
125 125
       if base.nil?
126  
-        raise MultipleIncludedBlocks if instance_variable_defined?("@_included_block")
  126
+        raise MultipleIncludedBlocks if instance_variable_defined?(:@_included_block)
127 127
 
128 128
         @_included_block = block
129 129
       else

0 notes on commit b296edd

Please sign in to comment.
Something went wrong with that request. Please try again.