[rspec-users] RSpec get model attribute values by name

James Byrne lists at ruby-forum.com
Fri Jan 30 18:56:30 EST 2009


Zach Dennis wrote:

> 
> m = MyModel.new :name => "foo"
> m["name"]      # => "foo"
> 
> http://www.railsbrain.com/api/rails-2.2.2/doc/index.html?a=M001972&name=[]
> 
> On a different note, how about some better variable names?

That code was for demonstration purposes for this question only.
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list