Displaying 2 results from an estimated 2 matches for "find_by_part_name".
Did you mean:
find_by_last_name
2006 Jan 11
0
Easy Question, I Think
...@part_number = PartNumber.new(params[:part_number])
# I dont want to create a part name because there is more to it than this
# but I want creation to fail. It does, but the field is not highlighted
# because the object is not specifically invalidated?
@part.part_name = PartName.find_by_part_name(params[:part_name][:part_name])
# The find portion of this seems to try to find the record,
regardless of whether
# the input is of the wrong type. I suppose that makes sense, but
there must
# be an easier way than explicitly calling .valid?
if @part_number.valid?
@part.par...
2006 Jan 12
0
Easy Question, I Think [re-post, sorry if dupe]
...@part_number = PartNumber.new(params[:part_number])
# I dont want to create a part name because there is more to it than this
# but I want creation to fail. It does, but the field is not highlighted
# because the object is not specifically invalidated?
@part.part_name = PartName.find_by_part_name(params[:part_name][:part_name])
# The find portion of this seems to try to find the record,
regardless of whether
# the input is of the wrong type. I suppose that makes sense, but
there must
# be an easier way than explicitly calling .valid?
if @part_number.valid?
@part.par...