# Reading n writing object attributes

**URL:** <https://discuss.rubyonrails.org/t/reading-n-writing-object-attributes/35785>\
**Category:** rubyonrails-talk\
**Created:** [October 28, 2008, 3:10am UTC](https://discuss.rubyonrails.org/t/reading-n-writing-object-attributes/35785 "2008-10-28T03:10:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Zotter](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@Robert\_Zotter](https://discuss.rubyonrails.org/u/Robert_Zotter)\
**Post date:** [October 28, 2008, 3:10am UTC](https://discuss.rubyonrails.org/t/reading-n-writing-object-attributes/35785/1 "2008-10-28T03:10:55Z")

</div>

Soh,

Not sure why you are not able to access the attributes in the use case but can I ask why you are not using the dynamic find\_by methods ie User.find\_by\_username('kena') ?

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [October 28, 2008, 12:36pm UTC](https://discuss.rubyonrails.org/t/reading-n-writing-object-attributes/35785/2 "2008-10-28T12:36:45Z")

</div>

Robert Zotter wrote:

> Soh,
> 
> Not sure why you are not able to access the attributes in the use case but can I ask why you are not using the dynamic find\_by methods ie User.find\_by\_username('kena') ?
> 
> -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting
> 
> On Oct 27, 6:49�pm, Soh Dubom \<rails-mailing-l...@andreas-s.net\>

I will definitely use the dynamic method, but I was just wondering why the other way was going wrong. I didn't have any private nor protected methods and I was reloading my console with: reload! ... I then decided to re-start my machine and now it works fine. Unfortunately I cannot reproduce that problem now ... let's consider that a good thing ... thanks anyway 🙂
