Permalink
Browse files

remove private attribute reader

  • Loading branch information...
tenderlove authored and rafaelfranca committed Jul 2, 2013
1 parent 7d2c414 commit 714634ad02b443ab51f8ef3ded324de411715d2a
@@ -48,20 +48,16 @@ def define_attribute_methods # :nodoc:
# Use a mutex; we don't want two thread simultaneously trying to define
# attribute methods.
generated_attribute_methods.synchronize do
- return false if attribute_methods_generated?
@bcardarella

bcardarella Apr 3, 2014

Contributor

How was this not a public API change? This method was clearly a public method.

@rafaelfranca

rafaelfranca Apr 3, 2014

Owner

It was public but never part of the public API. See the :nodoc: comment below

@bcardarella

bcardarella Apr 3, 2014

Contributor

Stuff like this is incredibly frustrating to develop against. Now I have to check the API docs for each method signature to determine if it is actually public or not?

@rafaelfranca

rafaelfranca Apr 3, 2014

Owner

No. You can check the code and see #:nodoc

+ return false if @attribute_methods_generated
superclass.define_attribute_methods unless self == base_class
super(column_names)
@attribute_methods_generated = true
end
true
end
- def attribute_methods_generated? # :nodoc:
- @attribute_methods_generated
- end
-
def undefine_attribute_methods # :nodoc:
- super if attribute_methods_generated?
+ super if @attribute_methods_generated
@attribute_methods_generated = false
end
@@ -49,9 +49,9 @@ def test_define_attribute_methods
end
def test_attribute_methods_generated?
- assert(!@klass.attribute_methods_generated?, 'attribute_methods_generated?')
+ assert_not @klass.method_defined?(:one)
@klass.define_attribute_methods
- assert(@klass.attribute_methods_generated?, 'attribute_methods_generated?')
+ assert @klass.method_defined?(:one)
end
end
end

0 comments on commit 714634a

Please sign in to comment.