Displaying 1 result from an estimated 1 matches for "survey_results_name".
2006 Jun 30
0
Three ActiveRecord features we want at work - any comments/suggestions?
...e ActiveRecord bit (finally). What I want to do is merge
in the attributes so I can access them in the Main class like this:
sr = SurveyResult.find(:first)
puts sr.name
sr.name = ''William''
and what effectively happens is:
sr = SurveyResult.find(:first)
puts sr.survey_results_name.name
sr.survey_results_name.name = ''William''
Now I''ve sort of dreamed up syntax for this, along the lines of:
class SurveyResult < ActiveRecord::Base
#has_one :survey_result_name # get rid of this
acts_as_optional :name
end
sr = SurveyResult.f...