def new(options = {})
      raise ArgumentError.new("Creating on a relation requires the parent be saved first.") if @related_object.nil?

      id_field = (@related_object.class.to_s.underscore + '_id').to_sym
      new_obj = @klass.new(options.merge(id_field => @related_object.id))

      new_obj
    end
def new(options = {})
      raise ArgumentError.new("Creating on a relation requires the parent be saved first.") if @related_object.nil?

      id_field = (@related_object.class.to_s.underscore + '_id').to_sym
      new_obj = @klass.new(options.merge(id_field => @related_object.id))

      new_obj
    end
def new ( options = { } ) raise ArgumentError . new ( "Creating on a relation requires the parent be saved first." ) if @related_object . nil? id_field = ( @related_object . class . to_s . underscore + '_id' ) . to_sym new_obj = @klass . new ( options . merge ( id_field => @related_object . id ) ) new_obj end
task.assignees.new(:name => 'BoB')
 creates a new unsaved Assignee object on the Task object task
task . assignees . new ( : name = > BoB ) creates a new unsaved Assignee object on the Task object task