Skip to content

Commit a047a0a

Browse files
committed
Add some missing comments
1 parent dbf1dba commit a047a0a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/dynamoid/fields/declare.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def warn_about_method_overriding
4343
end
4444

4545
def generate_instance_methods
46+
# only local variable is visible in `module_eval` block
4647
name = @name
4748

4849
@source.generated_methods.module_eval do
@@ -62,9 +63,11 @@ def generate_instance_methods
6263
end
6364

6465
def generate_instance_methods_for_alias
65-
alias_name = @options[:alias].to_sym
66+
# only local variable is visible in `module_eval` block
6667
name = @name
6768

69+
alias_name = @options[:alias].to_sym
70+
6871
@source.generated_methods.module_eval do
6972
alias_method alias_name, name
7073
alias_method "#{alias_name}=", "#{name}="

0 commit comments

Comments
 (0)